Liquid Net - Pytorch
Project description
LiquidNet
This is a simple implementation of the Liquid net official repo translated into pytorch for simplicity. Find the original repo here:
Install
pip install liquidnet
Usage
import torch
from liquidnet.main import LiquidNet
# Create an LiquidNet with a specified number of units
num_units = 64
ltc_cell = LiquidNet(num_units)
# Generate random input data with batch size 4 and input size 32
batch_size = 4
input_size = 32
inputs = torch.randn(batch_size, input_size)
# Initialize the cell state (hidden state)
initial_state = torch.zeros(batch_size, num_units)
# Forward pass through the LiquidNet
outputs, final_state = ltc_cell(inputs, initial_state)
# Print the shape of outputs and final_state
print("Outputs shape:", outputs.shape)
print("Final state shape:", final_state.shape)
VisionLiquidNet
- Simple model with 2 convolutions with 2 max pools, alot of room for improvement
import torch
from liquidnet.vision_liquidnet import VisionLiquidNet
# Random Input Image
x = torch.randn(4, 3, 32, 32)
# Create a VisionLiquidNet with a specified number of units
model = VisionLiquidNet(64, 10)
# Forward pass through the VisionLiquidNet
print(model(x).shape)
Citation
@article{DBLP:journals/corr/abs-2006-04439,
author = {Ramin M. Hasani and
Mathias Lechner and
Alexander Amini and
Daniela Rus and
Radu Grosu},
title = {Liquid Time-constant Networks},
journal = {CoRR},
volume = {abs/2006.04439},
year = {2020},
url = {https://arxiv.org/abs/2006.04439},
eprinttype = {arXiv},
eprint = {2006.04439},
timestamp = {Fri, 12 Jun 2020 14:02:57 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-2006-04439.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
License
MIT
Todo:
- Implement LiquidNet for vision and train on CIFAR
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
liquidnet-0.0.5.tar.gz
(7.2 kB
view details)
Built Distribution
File details
Details for the file liquidnet-0.0.5.tar.gz
.
File metadata
- Download URL: liquidnet-0.0.5.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5163e3341c40a932025cba788dbc181517c4dd26b6e0ae1c63d4ca5a768625a3 |
|
MD5 | c0a0dd9aa20b114a2d81978e2fd175c8 |
|
BLAKE2b-256 | 9a353b75c0e49bee70341fc2c43d61e4d5537c1084a36da78d2517d507317b7d |
File details
Details for the file liquidnet-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: liquidnet-0.0.5-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b74aeb3c3e3c2ec0ea8a37329fae1f5bf7acb17571a4e041c588cd874c0cdda2 |
|
MD5 | 3592ae2d7f93dc06da6bb39e037325e6 |
|
BLAKE2b-256 | 8573a66f1bae5f1fb4efb84f40ef23cf018ae6d12cf62fafd400dc624defe84e |