Skip to main content

A simple deep learning library for JAX.

Project description

SNAX

Hungry for a dead-simple functional deep learning library?

You came to the right place.

Creating a Multi-layer perceptron

import jax
import jax.numpy as jnp
import snax

hidden_sizes = [10, 20, 30]
input_size = 3
key = jax.random.PRNGKey(0)

mlp = snax.nn.MLP(key,
                  input_size,
                  hidden_sizes,
                  act_fn=jax.nn.relu)
out = mlp(jnp.ones([input_size]))

Creating a deep LSTM

import jax
import jax.numpy as jnp
import snax

input_size = 3
num_steps = 40
hidden_layer_sizes = [32, 64, 32]
key = jax.random.PRNGKey(0)

lstm = snax.recurrent.LSTM(key,
                           input_size,
                           hidden_layer_sizes,
                           act_fn=jnp.tanh,
                           forget_gate_bias_init=1.)


# Run the LSTM on some inputs
inputs = jnp.zeros((num_steps, input_size))
new_state, outs = LSTM(inputs, lstm.initial_state())

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

snaxlib-0.0.34.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

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

snaxlib-0.0.34-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file snaxlib-0.0.34.tar.gz.

File metadata

  • Download URL: snaxlib-0.0.34.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for snaxlib-0.0.34.tar.gz
Algorithm Hash digest
SHA256 98d17549972810eea86cabb837bec992c78bdb3bb13a44ee4e005aea454c5a58
MD5 1d9f92983a71229e4f82c2296d7c5c6f
BLAKE2b-256 c8ca43e8b0ec018ca786a79e8c019166752892aef5662974ddfd1f5a8c7c1c61

See more details on using hashes here.

File details

Details for the file snaxlib-0.0.34-py3-none-any.whl.

File metadata

  • Download URL: snaxlib-0.0.34-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for snaxlib-0.0.34-py3-none-any.whl
Algorithm Hash digest
SHA256 ab3fb2ba8e1dc4bb76e7cf65d5836b63ce0dcb08394fc3f7f236c4e3ec96750b
MD5 2c9b12d57c0dbef1fdacef70a1bc61c6
BLAKE2b-256 0fa64257f28686b72b0bfa7ab412c50a56403d4ca14aa5b51a0c870e58767ea7

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