TFNetworkSegModLayer

TFNetworkSegModLayer.batch_sizes_after_windowing(sizes, window)[source]
Parameters:
  • sizes (tf.Tensor) – (batch_sizes)
  • window (int) – size of the applied window
Returns:

sizes for each batch after applying a window on each batch

Return type:

tf.Tensor

TFNetworkSegModLayer.batch_indices_after_windowing(sizes, window)[source]

here we compute the start and end times for each of the new batches when applying a window :param tf.Tensor sizes: (batch_sizes) :param int window: size of the applied window :return: tensor of shape (?, 3), contains batch index, start-frame and end-frame for each batch after applying a window :rtype: tf.Tensor

class TFNetworkSegModLayer.SegmentInputLayer(window=15, **kwargs)[source]

This layer takes the input data, applies a window and outputs each window as a new batch, this is more efficient than a window as a new dimension if sequences have varying lengths

layer_class = 'segment_input'[source]
classmethod get_out_data_from_opts(name, sources, window, **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.ClassesToSegmentsLayer(num_classes, window=15, **kwargs)[source]

This layer takes a sequence of classes (=> sparse input) and applies a window (same as SegmentInput) to it. For each position t in the window it computes the relative frequencies of the classes up to and including that position t.

layer_class = 'classes_to_segments'[source]
classmethod get_out_data_from_opts(name, sources, num_classes, window, **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.ClassesToLengthDistributionLayer(window=15, scale=1.0, **kwargs)[source]
layer_class = 'classes_to_length_distribution'[source]
classmethod get_out_data_from_opts(name, sources, window, **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.ClassesToLengthDistributionGlobalLayer(window=15, weight_falloff=1.0, target_smoothing=None, min_length=1, broadcast_axis='time', **kwargs)[source]
layer_class = 'classes_to_length_distribution_global'[source]
classmethod get_out_data_from_opts(name, sources, window, broadcast_axis='time', **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.SegmentAlignmentLayer(num_classes, window=15, **kwargs)[source]
layer_class = 'segment_alignment'[source]
classmethod get_out_data_from_opts(name, sources, num_classes, window, **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.UnsegmentInputLayer(**kwargs)[source]

Takes the output of SegmentInput (sequences windowed over time and folded into batch-dim) and restores the original batch dimension. The feature dimension contains window * original_features many entries. The entries at time t all correspond to windows ending at time t. The window that started in the same frame comes first, then the window that started in the frame before and so on. This is also the format used for the segmental decoder in RASR.

layer_class = 'unsegment_input'[source]
classmethod get_out_data_from_opts(name, sources, **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.FillUnusedMemoryLayer(fill_value=0.0, **kwargs)[source]

Fills all unused entries in the time/batch/feature tensor with a constant

layer_class = 'fill_unused'[source]
classmethod get_out_data_from_opts(name, sources=(), **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.SwapTimeFeatureLayer(**kwargs)[source]
layer_class = 'swap_time_feature'[source]
classmethod get_out_data_from_opts(name, sources=(), **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.FlattenTimeLayer(**kwargs)[source]
layer_class = 'flatten_time'[source]
classmethod get_out_data_from_opts(name, sources, **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.ApplyLengthDistributionLayer(length_model_scale=1.0, **kwargs)[source]
layer_class = 'apply_length_distribution'[source]
classmethod get_out_data_from_opts(name, sources, **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data
class TFNetworkSegModLayer.NormalizeLengthScoresLayer(**kwargs)[source]
layer_class = 'normalize_length_scores'[source]
classmethod get_out_data_from_opts(name, sources, **kwargs)[source]

Gets a Data template (i.e. shape etc is set but not the placeholder) for our __init__ args. The purpose of having this as a separate classmethod is to be able to infer the shape information without having to construct the layer. This function should not create any nodes in the computation graph.

Parameters:kwargs – all the same kwargs as for self.__init__()
Returns:Data template (placeholder not set)
Return type:Data