Operations
Op namespaces — sd.math, sd.nn, sd.cnn, sd.rnn, sd.loss, sd.random — and SDVariable methods
Common Properties
SDVariable linear = weights.mmul("matrix_product", input).add(bias);
SDVariable output = sd.nn.sigmoid("output", linear);Two Families of Operations
SDVariable Instance Methods
Linear algebra (BLAS-style)
Method
Description
Comparison
Method
Description
Reductions
Method
Description
Shape manipulation
Method
Description
Chaining example
SameDiff Namespace Operations
sd.math — General Mathematical Operations
sd.math — General Mathematical OperationsPower and exponential functions
Trigonometric and hyperbolic functions
Elementwise miscellaneous
Reductions
Distance operations (between two identically-shaped variables)
Matrix operations
Logical operations
Chaining in math
mathsd.random — Random Number Generators
sd.random — Random Number GeneratorsFixed-shape random variables
Dynamic-shape random variables
sd.nn — Neural Network Layers and Activations
sd.nn — Neural Network Layers and ActivationsDense layers
Activation functions
Regularisation
Padding
Full example: two-layer feedforward network
sd.cnn — Convolutional Neural Network Operations
sd.cnn — Convolutional Neural Network OperationsConvolution operations
Deconvolution (transposed convolution)
Pooling
Upsampling
Local response normalisation
Full example: simple ConvNet block
sd.rnn — Recurrent Neural Network Operations
sd.rnn — Recurrent Neural Network OperationsSimple Recurrent Units (SRU)
LSTM
GRU
sd.loss — Loss Functions
sd.loss — Loss FunctionsCommon loss functions
Reduction methods
Weighted loss example
The Don'ts of Operations
Don't mix variables from different SameDiff instances
SameDiff instancesDon't discard operation results
Don't redefine existing named variables
Finding Operations in the Javadoc
Last updated
Was this helpful?