speechbrain.nnet.linear module¶
Library implementing linear transformation.
- Authors
Mirco Ravanelli 2020
Reference¶
-
class
speechbrain.nnet.linear.
Linear
(n_neurons, input_shape=None, input_size=None, bias=True, combine_dims=False)[source]¶ Bases:
torch.nn.modules.module.Module
Computes a linear transformation y = wx + b.
- Parameters
Example
>>> inputs = torch.rand(10, 50, 40) >>> lin_t = Linear(input_shape=(10, 50, 40), n_neurons=100) >>> output = lin_t(inputs) >>> output.shape torch.Size([10, 50, 100])
-
forward
(x)[source]¶ Returns the linear transformation of input tensor.
- Parameters
x (torch.Tensor) – Input to transform linearly.