def convert(cls, gsn, input_idx=0, label_idx=None):
        """
        'convert' essentially serves as the constructor for JointGSN.

        Parameters
        ----------
        gsn : GSN
        input_idx : int
            The index of the layer which serves as the "input" to the
            network. During classification, this layer will be given.
            Defaults to 0.
        label_idx : int
            The index of the layer which serves as the "output" of the
            network. This label is predicted during classification.
            Defaults to top layer of network.
        """
        gsn = copy.copy(gsn)
        gsn.__class__ = cls
        gsn.input_idx = input_idx
        gsn.label_idx = label_idx or (gsn.nlayers - 1)
        return gsn