A neural network library built on top of TensorFlow for quickly building deep learning models.
Project description
A neural network library built on top of TensorFlow for quickly building deep learning models.
Installation
pip install tensorflow
and run:
pip install nn
It is recommended to use a virtual environment.
Getting Started
import nn
# Define the network (layers, number of units, activations) as a function:
def network(inputs):
hidden = nn.Dense(units=64, activation='relu')(inputs)
outputs = nn.Dense(units=10)(hidden)
return outputs
# Create a model by configuring its learning process (loss, optimizer, evaluation metrics):
model = nn.Model(network,
loss='softmax_cross_entropy',
optimizer=('GradientDescent', 0.001),
metrics=['accuracy'])
# Train the model using training data:
model.train(x_train, y_train, epochs=30, batch_size=128)
# Evaluate the model performance on test or validation data:
loss_and_metrics = model.evaluate(x_test, y_test)
# Use the model to make predictions for new data:
predictions = model.predict(x)
# or call the model directly
predictions = model(x)
Documentation
See documentation.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nn-0.0.3.tar.gz
(3.4 kB
view hashes)