speechbrain.nnet.transducer.transducer_joint module

Library implementing transducer_joint.

Author

Abdelwahab HEBA 2020

Summary

Classes:

Transducer_joint

Computes joint tensor between Transcription network (TN) & Prediction network (PN)

Reference

class speechbrain.nnet.transducer.transducer_joint.Transducer_joint(joint_network=None, joint='sum', nonlinearity=<class 'torch.nn.modules.activation.LeakyReLU'>)[source]

Bases: torch.nn.modules.module.Module

Computes joint tensor between Transcription network (TN) & Prediction network (PN)

Parameters
  • joint_network (torch.class (neural network modules)) – if joint == “concat”, we call this network after the concatenation of TN and PN if None, we don’t use this network.

  • joint (joint the two tensors by ("sum",or "concat") option.) –

  • nonlinearity (torch class) –

    Activation function used after the joint between TN and PN

    Type of nonlinearity (tanh, relu).

Example

>>> from speechbrain.nnet.transducer.transducer_joint import Transducer_joint
>>> from speechbrain.nnet.linear import Linear
>>> input_TN = torch.rand(8, 200, 1, 40)
>>> input_PN = torch.rand(8, 1, 12, 40)
>>> joint_network = Linear(input_size=80, n_neurons=80)
>>> TJoint = Transducer_joint(joint_network, joint="concat")
>>> output = TJoint(input_TN, input_PN)
>>> output.shape
torch.Size([8, 200, 12, 80])
init_params(first_input)[source]
Parameters

first_input (tensor) – A first input used for initializing the parameters.

forward(input_TN, input_PN)[source]

Returns the fusion of inputs tensors.

Parameters
  • input_TN (torch.Tensor) – Input from Transcription Network.

  • input_PN (torch.Tensor) – Input from Prediction Network.

training: bool