lib for development with machine learning
Project description
Install:
$ pip install adrianna -U
Examples:
Bases
Neuro V1 (binary)
from adrianna.neuro.base_v1 import NeuralNetwork
import numpy as np
# Exemplo de uso
if __name__ == "__main__":
# Dados de entrada e saída
X = np.array([[3, 1, 2], [1, 24, 5], [2, 42, 5], [2, 23, 3]])
y = np.array([[1], [0], [1], [0]])
# Criação e treinamento da rede neural
input_size = X.shape[1] # Número de colunas das listas
hidden_size = 4 # Número de neurônios na camada oculta
output_size = y.shape[1] # Número de saídas
neural_net = NeuralNetwork(input_size, hidden_size, output_size, learning_rate=0.1)
neural_net.train(X, y, epochs=10000)
# Fazendo previsões
predictions = neural_net.predict(X)
predictions = np.round(predictions).astype(int)
print("Predictions:")
print(predictions)
Results:
...
Epoch 8000, Loss: 0.2617957
Epoch 8100, Loss: 0.1830651
Epoch 8200, Loss: 0.1800935
Epoch 8300, Loss: 0.2585192
Epoch 8400, Loss: 0.3310709
Epoch 8500, Loss: 0.3215849
Epoch 8600, Loss: 0.1803035
Epoch 8700, Loss: 0.1802555
Epoch 8800, Loss: 0.1807692
Epoch 8900, Loss: 0.3312975
Epoch 9000, Loss: 0.1800601
Epoch 9100, Loss: 0.2642676
Epoch 9200, Loss: 0.1930688
Epoch 9300, Loss: 0.3279387
Epoch 9400, Loss: 0.1871483
Epoch 9500, Loss: 0.1809427
Epoch 9600, Loss: 0.2635577
Epoch 9700, Loss: 0.1855325
Epoch 9800, Loss: 0.1796770
Epoch 9900, Loss: 0.1800897
Predictions:
[[1]
[0]
[1]
[1]]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file adrianna-0.0.7.2-py3-none-any.whl
.
File metadata
- Download URL: adrianna-0.0.7.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa9669d7c35d9b9c7a863f31d29bb517c62117aeeb5aae2cbf31c991c6f631b7 |
|
MD5 | aa03e1024808f90d19f9c5fb978c1119 |
|
BLAKE2b-256 | 8fcd16cc97df4e9e2fc54916dc2a5913b9e448bdba703ba328c87230fcef4f55 |