Example #1
0
    def output_ports(self):
        """Returns definitions of module output ports.

        intent_logits:
            0: AxisType(BatchTag)

            1: AxisType(ChannelTag)

        slot_logits:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

            2: AxisType(ChannelTag)
        """
        return {
            "intent_logits":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag)
            }),
            "slot_logits":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag),
                2: AxisType(ChannelTag)
            }),
        }
Example #2
0
    def output_ports(self):
        """Returns definitions of module output ports.

        loss:
            NeuralType(None)

        start_logits:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        end_logits:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)
        """
        return {
            "loss":
            NeuralType(None),
            "start_logits":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "end_logits":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
        }
Example #3
0
    def input_ports(self):
        """Returns definitions of module input ports.

        logits:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

            2: AxisType(ChannelTag)

        target_ids:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)
        """
        return {
            "logits":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag),
                2: AxisType(ChannelTag)
            }),
            "target_ids":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
        }
Example #4
0
    def create_ports():
        input_ports = {
            "decision": NeuralType({0: AxisType(BatchTag),
                                    1: AxisType(ChannelTag, 1)}),
        }

        output_ports = {"loss": NeuralType(None)}
        return input_ports, output_ports
Example #5
0
 def create_ports():
     input_ports = {}
     output_ports = {
         "latent": NeuralType({0: AxisType(BatchTag),
                               1: AxisType(ChannelTag, 64),
                               2: AxisType(HeightTag, 4),
                               3: AxisType(WidthTag, 4)})
     }
     return input_ports, output_ports
Example #6
0
    def input_ports(self):
        """Returns definitions of module input ports.

        hidden_states:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

            2: AxisType(ChannelTag)
        """
        return {"hidden_states": NeuralType({0: AxisType(BatchTag), 1: AxisType(TimeTag), 2: AxisType(ChannelTag)})}
    def output_ports(self):
        """Returns definitions of module output ports.

        decision:
            0: AxisType(BatchTag)

            1: AxisType(ChannelTag, 1)
        """
        return {
            "decision": NeuralType({0: AxisType(BatchTag),
                                    1: AxisType(ChannelTag, 1)})
        }
    def input_ports(self):
        """Returns definitions of module input ports.

        image1:
            0: AxisType(BatchTag)

            1: AxisType(ChannelTag)

            2: AxisType(HeightTag, 28)

            3: AxisType(WidthTag, 28)

        image2:
            0: AxisType(BatchTag)

            1: AxisType(ChannelTag)

            2: AxisType(HeightTag, 28)

            3: AxisType(WidthTag, 28)
        """
        return {
            "image1": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag),
                2: AxisType(HeightTag, 28),
                3: AxisType(WidthTag, 28)}),
            "image2": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag),
                2: AxisType(HeightTag, 28),
                3: AxisType(WidthTag, 28)})
        }
    def output_ports(self):
        """Returns definitions of module output ports.

        logits:
            0: AxisType(BatchTag)

            1: AxisType(ChannelTag)
        """
        return {
            "logits": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag)
            })
        }
Example #10
0
    def output_ports(self):
        """Returns definitions of module output ports.

        preds:
            0: AxisType(RegressionTag)
        """
        return {"preds": NeuralType({0: AxisType(RegressionTag)})}
Example #11
0
    def output_ports(self):
        """Returns definitions of module output ports.

            input_ids:
                0: AxisType(BatchTag)

                1: AxisType(TimeTag)

            input_type_ids:
                0: AxisType(BatchTag)

                1: AxisType(TimeTag)

            input_mask:
                0: AxisType(BatchTag)

                1: AxisType(TimeTag)

            start_positions:
                0: AxisType(BatchTag)

            end_positions:
                0: AxisType(BatchTag)

            unique_ids:
                0: AxisType(BatchTag)

        """
        return {
            "input_ids":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "input_type_ids":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "input_mask":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "start_positions":
            NeuralType({0: AxisType(BatchTag)}),
            "end_positions":
            NeuralType({0: AxisType(BatchTag)}),
            "unique_ids":
            NeuralType({0: AxisType(BatchTag)}),
        }
Example #12
0
    def output_ports(self):
        """Returns definitions of module output ports.

        input_ids:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        input_type_ids:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        input_mask:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        labels:
            0: AxisType(BatchTag)

        """
        return {
            "input_ids": NeuralType({0: AxisType(BatchTag), 1: AxisType(TimeTag)}),
            "input_type_ids": NeuralType({0: AxisType(BatchTag), 1: AxisType(TimeTag)}),
            "input_mask": NeuralType({0: AxisType(BatchTag), 1: AxisType(TimeTag)}),
            "labels": NeuralType({0: AxisType(BatchTag)}),
        }
Example #13
0
    def input_ports(self):
        """Returns definitions of module input ports.

        logits:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

            2: AxisType(ChannelTag)

        labels:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        loss_mask:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)
        """
        return {
            "logits": NeuralType({0: AxisType(BatchTag), 1: AxisType(TimeTag), 2: AxisType(ChannelTag)}),
            "labels": NeuralType({0: AxisType(BatchTag), 1: AxisType(TimeTag)}),
            "loss_mask": NeuralType({0: AxisType(BatchTag), 1: AxisType(TimeTag)}),
        }
Example #14
0
 def create_ports(input_size=(32, 32)):
     input_ports = {}
     output_ports = {
         "latent": NeuralType({0: AxisType(BatchTag),
                               1: AxisType(ChannelTag, 64),
                               2: AxisType(HeightTag, 4),
                               3: AxisType(WidthTag, 4)}),
         "image": NeuralType({0: AxisType(BatchTag),
                              1: AxisType(ChannelTag),
                              2: AxisType(HeightTag, input_size[1]),
                              3: AxisType(WidthTag, input_size[0])}),
         "label": NeuralType({0: AxisType(BatchTag)})
     }
     return input_ports, output_ports
    def output_ports(self):
        """Returns definitions of module output ports.

        interpolated_image:
            0: AxisType(BatchTag)

            1: AxisType(ChannelTag)

            2: AxisType(HeightTag, 28)

            3: AxisType(WidthTag, 28)
        """
        return {
            "interpolated_image": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag),
                2: AxisType(HeightTag, 28),
                3: AxisType(WidthTag, 28)})
        }
    def input_ports(self):
        """Returns definitions of module input ports.

        latents:
            0: AxisType(BatchTag)

            1: AxisType(ChannelTag, 64)

            2: AxisType(HeightTag, 4)

            3: AxisType(WidthTag, 4)
        """
        return {
            "latents": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag, 64),
                2: AxisType(HeightTag, 4),
                3: AxisType(WidthTag, 4)})
        }
Example #17
0
    def output_ports(self):
        """Returns definitions of module output ports.

        input_ids: indices of tokens which constitute batches of text segments
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        input_mask: bool tensor with 0s in place of tokens to be masked
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        labels: indices of tokens which should be predicted from each of the
            corresponding tokens in input_ids; for left-to-right language
            modeling equals to input_ids shifted by 1 to the right
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)
        """
        return {
            "input_ids": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "input_mask": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "labels": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
        }
Example #18
0
    def output_ports(self):
        """Returns definitions of module output ports.

        latent:
            0: AxisType(BatchTag)

            1: AxisType(ChannelTag, 64)

            2: AxisType(HeightTag, 4)

            3: AxisType(WidthTag, 4)

        image:
            0: AxisType(BatchTag)

            1: AxisType(ChannelTag)

            2: AxisType(HeightTag, user defined)

            3: AxisType(WidthTag, user defined)

        label:
            0: AxisType(BatchTag)
        """
        return {
            "latent":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag, 64),
                2: AxisType(HeightTag, 4),
                3: AxisType(WidthTag, 4),
            }),
            "image":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(ChannelTag),
                2: AxisType(HeightTag, self._input_size[1]),
                3: AxisType(WidthTag, self._input_size[0]),
            }),
            "label":
            NeuralType({0: AxisType(BatchTag)}),
        }
Example #19
0
 def create_ports():
     input_ports = {
         "image": NeuralType({0: AxisType(BatchTag),
                              1: AxisType(ChannelTag),
                              2: AxisType(HeightTag, 28),
                              3: AxisType(WidthTag, 28)})
     }
     output_ports = {
         "decision": NeuralType({0: AxisType(BatchTag),
                                 1: AxisType(ChannelTag, 1)})
     }
     return input_ports, output_ports
Example #20
0
    def create_ports():
        input_ports = {
            "interpolated_image": NeuralType({0: AxisType(BatchTag),
                                              1: AxisType(ChannelTag),
                                              2: AxisType(HeightTag, 28),
                                              3: AxisType(WidthTag, 28)}),
            "interpolated_decision": NeuralType({0: AxisType(BatchTag),
                                                 1: AxisType(ChannelTag, 1)}),
        }

        output_ports = {"loss": NeuralType(None)}
        return input_ports, output_ports
Example #21
0
    def output_ports(self):
        """Returns definitions of module output ports.

        src_ids: indices of tokens which correspond to source sentences
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        src_mask: bool tensor with 0s in place of source tokens to be masked
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        tgt_ids: indices of tokens which correspond to target sentences
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        tgt_mask: bool tensor with 0s in place of target tokens to be masked
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        labels: indices of tokens which should be predicted from each of the
            corresponding target tokens in tgt_ids; for standard neural
            machine translation equals to tgt_ids shifted by 1 to the right
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        sent_ids: indices of the sentences in a batch; important for
            evaluation with external metrics, such as SacreBLEU
            0: AxisType(BatchTag)

        """
        return {
            "src_ids": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "src_mask": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "tgt_ids": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "tgt_mask": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "labels": NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "sent_ids": NeuralType({0: AxisType(BatchTag)}),
        }
Example #22
0
    def output_ports(self):
        """Returns definitions of module output ports.

        input_ids: indices of tokens which constitute batches of text segments
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        input_type_ids: indices of token types (e.g., sentences A & B in BERT)
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        input_mask: bool tensor with 0s in place of tokens to be masked
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        output_ids: indices of output tokens which should be predicted
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        output_mask: bool tensor with 0s in place of tokens to be excluded
            from loss calculation
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        labels: indices of classes to be predicted from [CLS] token of text
            segments (e.g, 0 or 1 in next sentence prediction task)
            0: AxisType(BatchTag)

        """
        return {
            "input_ids":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "input_type_ids":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "input_mask":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "output_ids":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "output_mask":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "labels":
            NeuralType({0: AxisType(BatchTag)}),
        }
Example #23
0
    def create_ports():
        input_ports = {
            "image1": NeuralType({0: AxisType(BatchTag),
                                  1: AxisType(ChannelTag),
                                  2: AxisType(HeightTag, 28),
                                  3: AxisType(WidthTag, 28)}),
            "image2": NeuralType({0: AxisType(BatchTag),
                                  1: AxisType(ChannelTag),
                                  2: AxisType(HeightTag, 28),
                                  3: AxisType(WidthTag, 28)})
        }

        output_ports = {
            "interpolated_image": NeuralType({0: AxisType(BatchTag),
                                              1: AxisType(ChannelTag),
                                              2: AxisType(HeightTag, 28),
                                              3: AxisType(WidthTag, 28)})
        }
        return input_ports, output_ports
Example #24
0
    def output_ports(self):
        """Returns definitions of module output ports.

        input_ids:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        input_type_ids:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        input_mask:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        loss_mask:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        subtokens_mask:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        punct_labels:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        capit_labels:
            0: AxisType(BatchTag)

            1: AxisType(TimeTag)

        """
        return {
            "input_ids":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "input_type_ids":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "input_mask":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "loss_mask":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "subtokens_mask":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "punct_labels":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
            "capit_labels":
            NeuralType({
                0: AxisType(BatchTag),
                1: AxisType(TimeTag)
            }),
        }