Skip to main content

Liquid Net - Pytorch

Project description

Multi-Modality

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 liquid-net

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.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

liquidnet-0.0.3-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file liquidnet-0.0.3.tar.gz.

File metadata

  • Download URL: liquidnet-0.0.3.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

Hashes for liquidnet-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ff797e3459a1a11b335701892521b4044ecb732b29cfacef286acea556bfe9b1
MD5 e241d275c61d89841810ff08e1130ef1
BLAKE2b-256 ece13646968cced890d713f24978d3957c24275b6750ac1c4cce208f1fdaf141

See more details on using hashes here.

File details

Details for the file liquidnet-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: liquidnet-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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

Hashes for liquidnet-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 741b069819ab97437821d484320fcc62c7f843d1af5530a3c05195ac0df40294
MD5 14191b97fcfd930950ac994e54f744eb
BLAKE2b-256 765c4e07ff98f12019f5074cacc13fa2d2a217e2f9f9b1a19558347f2bed229d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page