semvec/pypi-packages huggingface dataset:
qstr 0.0.1
qstr

qstr: alternative functinal APIs for string functionss
=======================

## List of APIs

`capitalize`
`casefold`
`center`
`count`
`encode`
`endswith`
`expandtabs`
`find`
`format`
`format_map`
`index`
`isalnum`
`isalpha`
`isascii`
`isdecimal`
`isdigit`
`isidentifier`
`islower`
`isnumeric`
`isprintable`
`isspace`
`istitle`
`isupper`
`join`
`ljust`
`lower`
`lstrip`
`partition`
`removeprefix`
`removesuffix`
`replace`
`rfind`
`rindex`
`rjust`
`rpartition`
`rsplit`
`rstrip`
`split`
`splitlines`
`startswith`
`strip`
`swapcase`
`title`
`translate`
`upper`
`zfill`
stochasticprocess 0.2.0
Stochastic Process

stochasticprocesss
====

`stochasticprocess` is a package for stochastic processes.


### Usage Examples

```
from stochasticprocess.poisson import get_event_times, get_probability

# Example 1: Generate event times for a Poisson process with rate 2.0 until 5 events occur
rate = 2.0
event_count = 5
event_times = get_event_times(rate, event_count)
print(f"Event times for rate={rate} and event_count={event_count}: {event_times}")

# Example 2: Generate event times for a Poisson process with rate 2.0 up to time 10
max_time = 10.0
event_times = get_event_times(rate, event_count, max_time)
print(f"Event times for rate={rate} and max_time={max_time}: {event_times}")

# Example 3: Calculate the probability of observing exactly 5 events in time 10 with rate 2.0
event_count = 5
max_time = 10.0
probability = get_probability(rate, event_count, max_time)
print(f"Probability of observing exactly {event_count} events in time t={max_time} with rate={rate}: {probability:.4f}")
```
bayinf 0.1.0
Bayesian Inference

bayinf: Bayesian Inference
=======================

### Usage Examples

```
import numpy as np
from bayinf import infer_binomial, infer_poisson, infer_normal_known_variance, infer_normal_unknown_variance

# Binomial likelihood with Beta prior
data_binomial = [1, 1, 0, 1, 0, 1, 1, 0, 1, 0]
prior_alpha = 2
prior_beta = 2
print(f"Binomial Prior Alpha: {prior_alpha}")
print(f"Binomial Prior Beta: {prior_beta}")
posterior_alpha, posterior_beta = infer_binomial(data_binomial, prior_alpha, prior_beta)
print(f"Binomial Posterior Alpha: {posterior_alpha}")
print(f"Binomial Posterior Beta: {posterior_beta}")

# Poisson likelihood with Gamma prior
data_poisson = [2, 3, 1, 2, 4, 3, 2, 1, 3, 2]
prior_alpha = 1
prior_beta = 1
print(f"Poisson Prior Alpha: {prior_alpha}")
print(f"Poisson Prior Beta: {prior_beta}")
posterior_alpha, posterior_beta = infer_poisson(data_poisson, prior_alpha, prior_beta)
print(f"Poisson Posterior Alpha: {posterior_alpha}")
print(f"Poisson Posterior Beta: {posterior_beta}")

# Normal likelihood with known variance and Normal prior
data_normal_known_variance = [1.5, 2.0, 1.8, 2.2, 1.9, 2.1, 1.7, 2.3, 2.0, 1.6]
known_variance = 0.5
prior_mean = 0
prior_precision = 1
print(f"Normal (Known Variance) Prior Mean: {prior_mean}")
print(f"Normal (Known Variance) Prior Precision: {prior_precision}")
posterior_mean, posterior_precision = infer_normal_known_variance(data_normal_known_variance, known_variance, prior_mean, prior_precision)
print(f"Normal (Known Variance) Posterior Mean: {posterior_mean}")
print(f"Normal (Known Variance) Posterior Precision: {posterior_precision}")

# Normal likelihood with unknown variance and Normal-Gamma prior
data_normal_unknown_variance = [1.5, 2.0, 1.8, 2.2, 1.9, 2.1, 1.7, 2.3, 2.0, 1.6]
prior_mean = 0
prior_precision = 1
prior_df = 2
prior_scale = 1
print(f"Normal (Unknown Variance) Prior Mean: {prior_mean}")
print(f"Normal (Unknown Variance) Prior Precision: {prior_precision}")
print(f"Normal (Unknown Variance) Prior DF: {prior_df}")
print(f"Normal (Unknown Variance) Prior Scale: {prior_scale}")
posterior_mean, posterior_precision, posterior_df, posterior_scale = infer_normal_unknown_variance(data_normal_unknown_variance, prior_mean, prior_precision, prior_df, prior_scale)
print(f"Normal (Unknown Variance) Posterior Mean: {posterior_mean}")
print(f"Normal (Unknown Variance) Posterior Precision: {posterior_precision}")
print(f"Normal (Unknown Variance) Posterior DF: {posterior_df}")
print(f"Normal (Unknown Variance) Posterior Scale: {posterior_scale}")
```
nas 0.1.0
a package of network architecture search

nas: a package of Network Architecture Search
=======================

This package implements the most commonly used Network Architecture Search (NAS) algorithms.

### Usage Example

```
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import torch

# Generate synthetic dataset
x, y = make_classification(n_samples=1000, n_features=10, n_classes=2)
train_features, validate_features, train_targets, validate_targets = train_test_split(x, y, test_size=0.2)
scaler = StandardScaler()
train_features = scaler.fit_transform(train_features)
validate_features = scaler.transform(validate_features)

# Search
evolutionary_searcher = EvolutionarySearcher(input_dim=10, output_dim=2, population_size=10, mutation_rate=0.1, crossover_rate=0.7, generations=10)
best_architecture = evolutionary_searcher.search(train_features, train_targets, validate_features, validate_targets, verbose=True)
```
deepmeta 0.0.1
deepmeta

deepmeta: Deep Meta Learning
=======================

This package implements deep meta learning algorithms.

### Usage Example

```
import numpy as np
from tensorflow.keras import layers, models
from deepmeta import MAML

# Define a deep-network model
input_shape = (28, 28, 1)
category_count = 10
model = models.Sequential([
    layers.Conv2D(32, kernel_size=(3, 3), activation='relu', input_shape=input_shape),
    layers.MaxPooling2D(pool_size=(2, 2)),
    layers.Flatten(),
    layers.Dense(128, activation='relu'),
    layers.Dense(category_count, activation='softmax')
])

# Initialize MAML
maml = MAML(model, meta_lr=0.001, task_lr=0.01, inner_steps=5)

# Generate dummy data
train_sample_count = 100
test_sample_count = 50
train_features = np.random.rand(*([train_sample_count] + list(input_shape)))
train_targets = np.random.randint(0, category_count, size=(train_sample_count,))
test_features = np.random.rand(*([test_sample_count] + list(input_shape)))
test_targets = np.random.randint(0, category_count, size=(test_sample_count,))

# Split data into tasks
support_set = [(train_features[i:i+5], train_targets[i:i+5]) for i in range(0, 100, 5)]
query_set = [(test_features[i:i+5], test_targets[i:i+5]) for i in range(0, 50, 5)]

# Train MAML
for epoch in range(10):
    meta_loss = maml.train_step(support_set, query_set)
    print(f"epoch: {epoch}, meta loss: {meta_loss.numpy()}")
```