semvec/pypi-packages huggingface dataset:
deadrin 0.0.2
A Neural Network Library
License: MIT

# Madrin
A cute Neural Network library with Keras-like API with just 100 lines of code. Build for fun and educational purposes. Because the code is so simple, it is very easy to change to your needs. Still under active development. 

## Dependencies
- [numpy](https://numpy.org/install/) 

## Installation
```shell 
pip install madrin
```

## Demo

**Create a neural network:**<br>
You can create a Neural Network by passing a list of layers to the `Network` constructor.<br>
Currently it supports the following layers:
>`Linear(no_of_neurons, input_size)`<br>
>`Relu()`<br>
>`Sigmoid()`<br>
>`Tanh()`<br>
>`Softmax()`<br>

```python
import numpy as np

# Import the necessary classes from the madrin library
from madrin import Linear, Sigmoid, Relu, Tanh, Softmax, Network

# Generate some dummy data for training
np.random.seed(0)  # For reproducibility
X_train = np.random.randn(100, 3)  # 100 samples, 3 features each
y_train = np.random.randint(0, 3, 100)  # 100 labels (3 classes)

# Create the network
nn = Network([
    Linear(no_of_neurons=5, input_size=3),  # First layer: 3 input features, 5 neurons
    Relu(),  # ReLU activation
    Linear(no_of_neurons=3, input_size=5),  # Second layer: 5 input features, 3 neurons (output layer)
    Softmax()  # Softmax activation for multi-class classification
])

# Compile the network with loss function and learning rate
nn.compile(loss='categorical_crossentropy', lr=0.01)

# Train the network
nn.fit(X_train, y_train, epochs=1000)

# Make predictions
predictions = nn.forward(X_train)

# Print the predictions
print(predictions)

# Print the training costs
import matplotlib.pyplot as plt
plt.plot(nn.costs)
plt.xlabel('Epochs')
plt.ylabel('Cost')
plt.title('Training Cost Over Time')
plt.show()

```
### Contributing
Contributions are welcome! Please open an issue or submit a pull request on [Github](https://github.com/manohar3000/Madrin-A_Neural_Network_Library).

### License
Madrin is released under the MIT License.
dynamic-py-loader 1.0.0b3
A simple dynamic packages and modules loaders.
License: MIT
Requires Python: >=3.6

## A simple dynamic loader classes to load and store modules and packages during runtime.

## 1. Module Controller
### The `ModuleController` class is designed to store and work with dynamically loaded module.

### Usage:

```python
from dynamic_py_loader import ModuleController
from pathlib import Path

# Load, there is no need to call resolve(),
# also object can be inited empty to be loaded later:
absolute_path = Path(__file__).parent / 'module.py'
module = ModuleController(absolute_path)

# Access module global space:
value = module.global_var

# You can also get properties and get element obviously:
module.name  # 'module'
module.path
module.get('global_var1', None)  # Default value specified

# And reload object:
module.load_self(another_path)
```
-----------------

## 2. Package Controller
### The `PackageController` class is designed to store and work with dynamically loaded package.
### It can contain modules and subpackages, also imports all from `__init__.py`.

### Usage:

```python
from dynamic_py_loader import PackageLoader
from pathlib import Path

# Load will work even for modern package without __init__.py,
# also object can be inited empty:
absolute_path = Path(__file__).parent / 'package'
package = PackageLoader(absolute_path)

# Package will contain all modules and subpackages names, you can access them as attributes.
# To access elements in __init__.py you don't need to use modulename, they are applied directly to package name.
package.init_global_var
package.module.global_var
package.subpackage.subpackaeg_module.global_var

# You can also get iterator for all elements in package namespace:
[print(elem.name) for elem in package]

# It also has analogically api as module 
package.name  # 'package'
package.path

# Some modules or subpackages can be added even if they are from other path, or 
# package can be reloaded
package.load_self()
package.load_sub_package()
package.load_module()

# You can also get by name elements of some type or get all elements:
package.get_sub_package()
package.get_module()
package.get_all_elements()  # Same list as iterator moves around
```
-----------------

## 3. Dynamic loader wrapper (PackageController)
### Just wrapper to push arguments more comfortable and with ability to load modules and packages in the same level.

### Usage:

```python
from dynamic_py_loader import PackageLoader
from pathlib import Path

absolute_path = Path(__file__).parent / 'package'
package = PackageLoader(absolute_path)

package4 = PackageLoader('./pkg4')
packages = PackageLoader('./pkg1', ['./pkg2', './pkg3'], package4)

alias = packages.pkg1.pkg1_elem
```