(self, fn=None, keep_states=True)
return pdict
Creates a dictionary storing the layer parameters and epochs complete.

        Arguments:
            fn (str): file to save pkl formatted model dictionary
            keep_states (bool): Whether to save optimizer states.

        Returns:
            dict: Model data including layer parameters and epochs complete.
Creates a dictionary storing the layer parameters and epochs complete.
Creates a dictionary storing the layer parameters and epochs complete .
def serialize(self, fn=None, keep_states=True):
        """
        Creates a dictionary storing the layer parameters and epochs complete.

        Arguments:
            fn (str): file to save pkl formatted model dictionary
            keep_states (bool): Whether to save optimizer states.

        Returns:
            dict: Model data including layer parameters and epochs complete.
        """

        # get the model dict with the weights
        pdict = self.get_description(get_weights=True, keep_states=keep_states)
        pdict['epoch_index'] = self.epoch_index + 1
        if self.initialized:
            if not hasattr(self.layers, 'decoder'):
                pdict['train_input_shape'] = self.layers.in_shape
            else:
                # serialize shapes both for encoder and decoder
                pdict['train_input_shape'] = (self.layers.encoder.in_shape +
                                              self.layers.decoder.in_shape)
        if fn is not None:
            save_obj(pdict, fn)
            return
        return pdict
def serialize ( self , fn = None , keep_states = True ) : # get the model dict with the weights pdict = self . get_description ( get_weights = True , keep_states = keep_states ) pdict [ 'epoch_index' ] = self . epoch_index + 1 if self . initialized : if not hasattr ( self . layers , 'decoder' ) : pdict [ 'train_input_shape' ] = self . layers . in_shape else : # serialize shapes both for encoder and decoder pdict [ 'train_input_shape' ] = ( self . layers . encoder . in_shape + self . layers . decoder . in_shape ) if fn is not None : save_obj ( pdict , fn ) return return pdict