How to use the nemo.core.neural_types.NeuralType function in NEMO

To help you get started, we’ve selected a few NEMO examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NVIDIA / NeMo / collections / nemo_asr / nemo_asr / beam_search_decoder.py View on Github external
def create_ports():
        input_ports = {
            "log_probs": NeuralType({0: AxisType(BatchTag),
                                     1: AxisType(TimeTag),
                                     2: AxisType(ChannelTag)}),
            "log_probs_length": NeuralType({0: AxisType(BatchTag)})
        }

        output_ports = {
            "predictions": NeuralType(None)
        }
        return input_ports, output_ports
github NVIDIA / NeMo / collections / nemo_asr / nemo_asr / data_layer.py View on Github external
def create_ports():
        input_ports = {
            "input_signal": NeuralType({0: AxisType(BatchTag),
                                        1: AxisType(TimeTag)}),

            "length": NeuralType({0: AxisType(BatchTag)}),
        }

        output_ports = {
            "processed_signal": NeuralType({0: AxisType(BatchTag),
                                            1: AxisType(SpectrogramSignalTag),
                                            2: AxisType(ProcessedTimeTag)}),

            "processed_length": NeuralType({0: AxisType(BatchTag)})
        }
        return input_ports, output_ports
github NVIDIA / NeMo / collections / nemo_asr / nemo_asr / las / misc.py View on Github external
def create_ports():
        input_ports = {
            'tensor': NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag),
                2: AxisType(TimeTag)
            })
        }
        output_ports = {
            'tensor': NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag),
                2: AxisType(ChannelTag)
            })
        }
        return input_ports, output_ports
github NVIDIA / NeMo / nemo / nemo / backends / pytorch / common / rnn.py View on Github external
def create_ports():
        input_ports = {
            'targets': NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            'encoder_outputs': NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag),
                2: AxisType(ChannelTag)
            }, optional=True)
        }
        output_ports = {
            'log_probs': NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag),
                2: AxisType(ChannelTag)
            }),
            'attention_weights': NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag),
                2: AxisType(TimeTag)
            }, optional=True)
github NVIDIA / NeMo / collections / nemo_nlp / nemo_nlp / huggingface / bert.py View on Github external
0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        token_type_ids:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        attention_mask:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)
        """
        return {
            "input_ids": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "token_type_ids": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "attention_mask": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            })
github NVIDIA / NeMo / collections / nemo_asr / nemo_asr / jasper.py View on Github external
def create_ports():
        input_ports = {
            "audio_signal": NeuralType({0: AxisType(BatchTag),
                                        1: AxisType(SpectrogramSignalTag),
                                        2: AxisType(ProcessedTimeTag)}),
            "length": NeuralType({0: AxisType(BatchTag)})
        }

        output_ports = {
            "outputs": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(EncodedRepresentationTag),
                2: AxisType(ProcessedTimeTag),
            }),

            "encoded_lengths": NeuralType({0: AxisType(BatchTag)})
        }
        return input_ports, output_ports
github NVIDIA / NeMo / collections / nemo_asr / nemo_asr / losses.py View on Github external
def create_ports():
        input_ports = {
            "log_probs": NeuralType({1: AxisType(TimeTag),
                                     0: AxisType(BatchTag),
                                     2: AxisType(ChannelTag)}),

            "targets": NeuralType({0: AxisType(BatchTag),
                                   1: AxisType(TimeTag)}),

            "input_length": NeuralType({0: AxisType(BatchTag)}),

            "target_length": NeuralType({0: AxisType(BatchTag)})
        }

        output_ports = {"loss": NeuralType(None)}
        return input_ports, output_ports
github NVIDIA / NeMo / collections / nemo_asr / nemo_asr / greedy_ctc_decoder.py View on Github external
def create_ports():
        input_ports = {
            "log_probs": NeuralType({0: AxisType(BatchTag),
                                     1: AxisType(TimeTag),
                                     2: AxisType(ChannelTag)})
        }

        output_ports = {
            "predictions": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            })
        }
        return input_ports, output_ports
github NVIDIA / NeMo / collections / nemo_nlp / nemo_nlp / modules / dialog.py View on Github external
# }),
            'targets': NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag),  # the number of slots
                2: AxisType(TimeTag)
            }),

        }
        output_ports = {
            'point_outputs': NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag),
                2: AxisType(ChannelTag),
                3: AxisType(ChannelTag)
            }),
            'gate_outputs': NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag),
                2: AxisType(ChannelTag)
            })
        }
        return input_ports, output_ports
github NVIDIA / NeMo / collections / nemo_asr / nemo_asr / losses.py View on Github external
def create_ports():
        input_ports = {
            "log_probs": NeuralType({1: AxisType(TimeTag),
                                     0: AxisType(BatchTag),
                                     2: AxisType(ChannelTag)}),

            "targets": NeuralType({0: AxisType(BatchTag),
                                   1: AxisType(TimeTag)}),

            "input_length": NeuralType({0: AxisType(BatchTag)}),

            "target_length": NeuralType({0: AxisType(BatchTag)})
        }

        output_ports = {"loss": NeuralType(None)}
        return input_ports, output_ports