A simple, educational deep learning framework
Project description
FlowLite
FlowLite is a lightweight deep learning framework designed for educational purposes, with an API similar to PyTorch. It simplifies the process of building, training, and deploying neural networks, making it ideal for beginners and educators in the field of AI.
Installation
You can install FlowLite using pip:
pip install flowlite
Quick Start
Here's a quick example of using FlowLite to create a simple neural network:
import flowlite
import flowlite.nn as nn
import flowlite.optim as optim
import flowlite.functional as F
# Define a simple model
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.fc1 = nn.Linear(784, 128)
self.fc2 = nn.Linear(128, 10)
def forward(self, x):
x = F.relu(self.fc1(x))
x = self.fc2(x)
return x
# Initialize the model
model = Net()
# Define a loss function and optimizer
loss_fn = nn.CrossEntropyLoss()
optimizer = optim.SGD(model.parameters(), lr=0.01)
# Dummy data for the sake of example
inputs = flowlite.randn(64, 784) # Batch size 64, input dimension 784
labels = flowlite.randint(0, 10, (64,)) # Random labels for a batch size of 64
# Forward pass
outputs = model(inputs)
loss = loss_fn(outputs, labels)
# Backward pass and optimization
optimizer.zero_grad()
loss.backward()
optimizer.step()
print('Training step complete.')
License
This project is licensed under the Apache License (Version 2.0).
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flowlite-0.0.3.tar.gz.
File metadata
- Download URL: flowlite-0.0.3.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0542cc1001d8aad87646b7d6d6a5af4241925b4bd355c1a699527c2672bc6c58
|
|
| MD5 |
b48d269e5496957765f022703c6b0b6b
|
|
| BLAKE2b-256 |
026a9fafaf69f831297104e86c617b1f0ef72ac468f074e1e001e9582ca86e1d
|
File details
Details for the file flowlite-0.0.3-py3-none-any.whl.
File metadata
- Download URL: flowlite-0.0.3-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c315f005f36ea9956c8be3422e7afd17270bb59b63330368e7c30488e8c81c7d
|
|
| MD5 |
c3b444b81f65c17df79419b5d591b989
|
|
| BLAKE2b-256 |
f47050d443a9eac0aa654b0234abf3746397a0cf01a33d89848ff0e314d63006
|