candle_nn/
lib.rs

1//! candle-nn
2//!
3//! ## Other Crates
4//!
5//! Candle consists of a number of crates. This crate holds structs and functions
6//! that allow you to build and train neural nets. You may wish
7//! to look at the docs for the other crates which can be found here:
8//!
9//! - [candle-core](https://docs.rs/candle-core/). Core Datastructures and DataTypes.
10//! - [candle-nn](https://docs.rs/candle-nn/). Building blocks for Neural Nets.
11//! - [candle-datasets](https://docs.rs/candle-datasets/). Rust access to commonly used Datasets like MNIST.
12//! - [candle-examples](https://docs.rs/candle-examples/). Examples of Candle in Use.
13//! - [candle-onnx](https://docs.rs/candle-onnx/). Loading and using ONNX models.
14//! - [candle-pyo3](https://docs.rs/candle-pyo3/). Access to Candle from Python.
15//! - [candle-transformers](https://docs.rs/candle-transformers/). Candle implemntation of many published transformer models.
16//!
17
18pub mod activation;
19pub mod batch_norm;
20pub mod conv;
21pub mod embedding;
22pub mod encoding;
23pub mod func;
24pub mod group_norm;
25pub mod init;
26pub mod kv_cache;
27pub mod layer_norm;
28pub mod linear;
29pub mod loss;
30pub mod ops;
31pub mod optim;
32pub mod rnn;
33pub mod rotary_emb;
34pub mod sampling;
35pub mod sequential;
36pub mod var_builder;
37pub mod var_map;
38
39pub use activation::{prelu, Activation, PReLU};
40pub use batch_norm::{batch_norm, BatchNorm, BatchNormConfig};
41pub use conv::{
42    conv1d, conv1d_no_bias, conv2d, conv2d_no_bias, conv_transpose1d, conv_transpose1d_no_bias,
43    conv_transpose2d, conv_transpose2d_no_bias, Conv1d, Conv1dConfig, Conv2d, Conv2dConfig,
44    ConvTranspose1d, ConvTranspose1dConfig, ConvTranspose2d, ConvTranspose2dConfig,
45};
46pub use embedding::{embedding, Embedding};
47pub use func::{func, func_t, Func, FuncT};
48pub use group_norm::{group_norm, GroupNorm};
49pub use init::Init;
50pub use layer_norm::{
51    layer_norm, layer_norm_no_bias, rms_norm, LayerNorm, LayerNormConfig, RmsNorm,
52};
53pub use linear::{linear, linear_b, linear_no_bias, Linear};
54pub use ops::Dropout;
55pub use optim::{AdamW, Optimizer, ParamsAdamW, SGD};
56pub use rnn::{gru, lstm, GRUConfig, LSTMConfig, GRU, LSTM, RNN};
57pub use sequential::{seq, Sequential};
58pub use var_builder::VarBuilder;
59pub use var_map::VarMap;
60
61pub use candle::{Module, ModuleT};