1#![deny(missing_docs)]
21
22pub mod activation;
24pub mod attention;
26pub mod bilinear;
28pub mod conv;
30pub mod dropout;
32pub mod embedding;
34pub mod embeddingbag;
36pub mod init;
38pub mod interpolate;
40pub mod linear;
42pub mod loss;
44pub mod module;
46pub mod normalization;
48pub mod pool;
51pub mod positional;
53pub mod regularization;
55pub mod rnn;
57pub mod sequential;
59pub mod softmax;
61pub mod swiglu;
63pub mod transformer;
65
66pub use activation::{
67 celu, elu, gelu, gelu_tanh, glu, hardshrink, hardsigmoid, hardswish, hardtanh, leaky_relu,
68 log_sigmoid, mish, prelu, relu, sigmoid, silu, softplus, softshrink, softsign, tanh,
69 tanhshrink, threshold, Celu, CeluOp, GeLU, GeLUTanh, Hardshrink, HardshrinkOp, Hardsigmoid,
70 HardsigmoidOp, Hardswish, HardswishOp, Hardtanh, HardtanhOp, LeakyReLU, LogSigmoid, Mish,
71 PReLU, ReLU, SiLU, Sigmoid, Softplus, Softshrink, SoftshrinkOp, Softsign, SoftsignOp, Tanh,
72 Tanhshrink, Threshold, ThresholdNode, ELU, GLU,
73};
74pub use attention::{
75 multi_head_attention_cross, AttentionMask, CausalMask, MhaProjectionParams, MultiHeadAttention,
76 NullMask, ScaledDotProductAttention,
77};
78pub use bilinear::{bilinear, Bilinear};
79pub use conv::{
80 Conv, Conv1d, Conv2d, Conv3d, ConvDim, ConvTranspose, ConvTranspose1d, ConvTranspose2d,
81 ConvTranspose3d, DepthwiseConv3d, Dim1D, Dim2D, Dim3D, Fold1d, Fold2d, Unfold1d, Unfold2d,
82};
83pub use dropout::Dropout;
84pub use embedding::Embedding;
85pub use embeddingbag::{EmbeddingBag, EmbeddingBagMode};
86pub use init::{kaiming_uniform, xavier_uniform};
87pub use interpolate::{interpolate_1d, interpolate_2d, ResizeMode};
88pub use linear::Linear;
89pub use loss::{
90 bce_with_logits, binary_cross_entropy, cosine_embedding_loss, cosine_similarity,
91 cross_entropy_loss, ctc_loss, gaussian_nll_loss, hinge_embedding_loss, huber_loss,
92 kl_divergence, l1_loss, margin_ranking_loss, mse_loss, multi_label_soft_margin_loss,
93 multi_margin, nanmean, nansum, nll_loss, pairwise_distance, poisson_nll, smooth_l1_loss,
94 soft_margin, triplet_margin_loss, triplet_margin_with_distance_loss,
95};
96pub use module::{Module, ModuleError, ModuleResult, ParameterLoadError};
97pub use normalization::{
98 group_norm, layer_norm, rms_norm, BatchNorm1d, BatchNorm2d, BatchNorm3d, GroupNorm,
99 InstanceNorm1d, InstanceNorm2d, InstanceNorm3d, LayerNorm, NormalizedShape, RMSNorm,
100};
101pub use pool::{
102 AdaptiveAvgPool1d, AdaptiveAvgPool2d, AdaptiveMaxPool1d, AdaptiveMaxPool2d, AvgPool1d,
103 AvgPool2d, AvgPool3d, GlobalAvgPool1d, GlobalAvgPool2d, GlobalAvgPool3d, GlobalMaxPool2d,
104 GlobalMaxPool3d, MaxPool1d, MaxPool2d, MaxPool3d,
105};
106pub use positional::{RotaryEmbedding, SinusoidalEncoding};
107pub use regularization::{AlphaDropout, FeatureAlphaDropout, GaussianNoise, LocalResponseNorm};
108pub use rnn::{Bidirectional, GRUCell, Gru, LSTMCell, Lstm, RNNCell, Rnn, RnnNonlinearity};
109pub use sequential::{ModuleExt, Sequential, StaticSeq};
110pub use softmax::{softmax, Softmax};
111pub use swiglu::SwiGlu;
112pub use transformer::{
113 feed_forward, transformer_decoder_layer, transformer_encoder_layer, FeedForward, Transformer,
114 TransformerDecoder, TransformerDecoderLayer, TransformerDecoderLayerParams, TransformerEncoder,
115 TransformerEncoderLayer, TransformerEncoderLayerParams,
116};