semvec/pypi-packages huggingface dataset:
pyautograd 1.1.0
An auto-differentiation library for scalars
Requires Python: >=3.6

# Autograd

Autograd is an auto-differentiation library for scalars, designed to facilitate the implementation of machine learning models. It provides a simple interface for defining and training neural networks using automatic differentiation.

## Features

- **Automatic Differentiation**: Compute gradients automatically for scalar operations.
- **Neural Network Components**: Build neural networks using layers and neurons.
- **Optimizers**: Implement optimization algorithms (Currently only Stochastic Gradient Descent)
- **Loss Functions**: Support for common loss functions (Currently only Hinge Loss)

## Installation

To install the library, clone the repository:

```bash
pip install py-autograd
```

The only requirement is `numpy`

## Usage

### Importing the Library

You can import the necessary components from the library as follows:

```python
from autograd.scalar import Number, Layer, Network
from autograd.scalar.activations import ReLU
from autograd.scalar.losses import HingeLoss
from autograd.scalar.optimizers import Optimizer
```

### Using the Number class

The Number class wraps around python's integers and floats. It has all the building blocks including addition, multiplication, exponentiation, power, etc. During each calculation, the Number class stores the function to get the local gradient at the point.

```python
a = Number(3.0)
b = 10

c = a**10
d = c.exp()
e = d / a
f = 2*e
```

The number class also includes activation functions:

```python
from autograd.scalar.activations import ReLU
a = Number(-5.0)
b = a.activation(ReLU)
```

Finally, running the `.backward()` function on any `Number` object will calculate the gradients of all the variables before it. These gradients can be accessed by the `.grad` attribute

```python
f.backward()
a.grad
```


### Defining a Neural Network

You can also define a multi-layered perceptron (MLP) using the `Network` and `Layer` classes:

```python
model = Network([
    Layer(2, 16, ReLU()),
    Layer(16, 16, ReLU()),
    Layer(16, 1)
])
```

### Training the Model

To train the model, create an instance of the `Optimizer` class and call the `train` method. Currently, the library uses Stochastic Gradient Descent to train the model

```python
optimizer = Optimizer(model, HingeLoss)
optimizer.train(X, y, epochs=100, batch_size=32)
```


## Example

An example of using the library can be found in the `demo.ipynb` Jupyter notebook. This notebook demonstrates how to create a dataset, define a model, train it, and visualize the results.

## Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any suggestions or improvements.
py-order-utils 0.3.2
Python utilities used to generate and sign orders from Polymarket's Exchange
Requires Python: >=3.9.10

## Polymarket CLOB Python order-utils

<a href='https://pypi.org/project/py-order-utils'>
    <img src='https://img.shields.io/pypi/v/py-order-utils.svg' alt='PyPI'/>
</a>

Python utilities used to generate and sign orders from Polymarket's Exchange

### Install

```bash
pip install py-order-utils
```

### Usage

```py
from py_order_utils.builders import OrderBuilder
from py_order_utils.signer import Signer
from pprint import pprint

def main():
    exchange_address = "0x...."
    chain_id = 80002
    signer = Signer("0x....")
    builder = OrderBuilder(exchange_address, chain_id, signer)

    # Create and sign the order
    order = builder.build_signed_order(
        OrderData(
            ...
        )
    )

    # Generate the Order and Signature json to be sent to the CLOB API
    pprint(json.dumps(order.dict()))

```
py-autograd 0.1
An auto-differentiation library for scalars
Requires Python: >=3.6

# Autograd

Autograd is an auto-differentiation library for scalars, designed to facilitate the implementation of machine learning models. It provides a simple interface for defining and training neural networks using automatic differentiation.

## Features

- **Automatic Differentiation**: Compute gradients automatically for scalar operations.
- **Neural Network Components**: Build neural networks using layers and neurons.
- **Optimizers**: Implement optimization algorithms (Currently only Stochastic Gradient Descent)
- **Loss Functions**: Support for common loss functions (Currently only Hinge Loss)

## Installation

To install the library, clone the repository:

```bash
git clone https://github.com/affanhamid/autograd.git
```

The only requirement is `numpy`

## Usage

### Importing the Library

You can import the necessary components from the library as follows:

```python
from autograd.scalar import Number, Layer, Network
from autograd.scalar.activations import ReLU
from autograd.scalar.losses import HingeLoss
from autograd.scalar.optimizers import Optimizer
```

### Using the Number class

The Number class wraps around python's integers and floats. It has all the building blocks including addition, multiplication, exponentiation, power, etc. During each calculation, the Number class stores the function to get the local gradient at the point.

```python
a = Number(3.0)
b = 10

c = a**10
d = c.exp()
e = d / a
f = 2*e
```

The number class also includes activation functions:

```python
from autograd.scalar.activations import ReLU
a = Number(-5.0)
b = a.activation(ReLU)
```

Finally, running the `.backward()` function on any `Number` object will calculate the gradients of all the variables before it. These gradients can be accessed by the `.grad` attribute

```python
f.backward()
a.grad
```


### Defining a Neural Network

You can also define a multi-layered perceptron (MLP) using the `Network` and `Layer` classes:

```python
model = Network([
    Layer(2, 16, ReLU()),
    Layer(16, 16, ReLU()),
    Layer(16, 1)
])
```

### Training the Model

To train the model, create an instance of the `Optimizer` class and call the `train` method. Currently, the library uses Stochastic Gradient Descent to train the model

```python
optimizer = Optimizer(model, HingeLoss)
optimizer.train(X, y, epochs=100, batch_size=32)
```


## Example

An example of using the library can be found in the `demo.ipynb` Jupyter notebook. This notebook demonstrates how to create a dataset, define a model, train it, and visualize the results.

## Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any suggestions or improvements.
finch-genetics 3.5.3
A flexible framework for evolutionary algorithms in Python
Requires Python: >=3.7

# Finch: Evolutionary Algorithm Framework

Finch is a Python framework for implementing evolutionary algorithms. It provides a modular approach to building and experimenting with various evolutionary computation techniques.

## Key Features

- Modular design with customizable components
- Support for different types of genes (float arrays, strings, arrays)
- Various selection, crossover, and mutation operators
- GPU acceleration support using CuPy
- Visualization tools for monitoring evolution progress

## Main Components

1. **GenePool**: Generates initial populations
   - FloatPool, StringPool, ArrayPool, ImagePool

2. **Individual**: Represents a single solution in the population

3. **Layer**: Defines genetic operators
   - Selection layers
   - Crossover layers (e.g., N-Point, Uniform)
   - Mutation layers (e.g., Gaussian, Uniform, Polynomial, Swap, Inversion, Scramble)

4. **Environment**: Manages the evolution process

5. **Competition**: Allows comparing multiple evolutionary strategies

## Usage

1. Define your fitness function
2. Create a GenePool
3. Set up Layers for selection, crossover, and mutation
4. Initialize an Environment with your layers and individuals
5. Run the evolution process

## Example

```python

import Finch.layers as layers
from Finch.selectors import *
from Finch.generic import *

def fitness_function(individual):
    return sum(individual.item)

gene_pool = layers.float_arrays.FloatPool(ranges=[[-5, 5]] * 10, length=10, fitness_function=fitness_function)
mutation_selection = RandomSelection(percent_to_select=.1)
crossover_selection = RandomSelection(amount_to_select=2)

# Set up layers
layers = [
    layers.universal_layers.Populate(population=500, gene_pool=gene_pool),
    layers.array_layers.ParentNPoint(selection_function=crossover_selection.select, families=4, children=4),
    layers.float_arrays.GaussianMutation(mutation_rate=0.1, sigma=0.5, selection_function=mutation_selection.select),
    layers.universal_layers.SortByFitness(),
    layers.universal_layers.CapPopulation(1000),
]

env = Environment(layers)
env.compile()
env.evolve(generations=1000)

print(env.best_ever.item)
env.plot()
```

## Installation

```
pip install finch-genetics
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License.