def get_config(self):
     config = {'units': self.units,
               'projection_units': self.projection_units,
               'activation': activations.serialize(self.activation),
               'recurrent_activation': activations.serialize(self.recurrent_activation),
               'projection_activation': activations.serialize(self.projection_activation),
               'use_bias': self.use_bias,
               'kernel_initializer': initializers.serialize(self.kernel_initializer),
               'recurrent_initializer': initializers.serialize(self.recurrent_initializer),
               'bias_initializer': initializers.serialize(self.bias_initializer),
               'projection_initializer': initializers.serialize(self.projection_initializer),
               'unit_forget_bias': self.unit_forget_bias,
               'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
               'recurrent_regularizer': regularizers.serialize(self.recurrent_regularizer),
               'bias_regularizer': regularizers.serialize(self.bias_regularizer),
               'projection_regularizer': regularizers.serialize(self.projection_regularizer),
               'activity_regularizer': regularizers.serialize(self.activity_regularizer),
               'kernel_constraint': constraints.serialize(self.kernel_constraint),
               'recurrent_constraint': constraints.serialize(self.recurrent_constraint),
               'bias_constraint': constraints.serialize(self.bias_constraint),
               'projection_constraint': constraints.serialize(self.projection_constraint),
               'dropout': self.dropout,
               'recurrent_dropout': self.recurrent_dropout,
               'implementation': self.implementation}
     base_config = super(NASRNN, self).get_config()
     del base_config['cell']
     return dict(list(base_config.items()) + list(config.items()))
Exemple #2
0
 def get_config(self):
     config = {'filters': self.filters,
             'kernel_size': self.kernel_size,
             'strides': self.strides,
             'padding': self.padding,
             'data_format': self.data_format,
             'dilation_rate': self.dilation_rate,
             'activation': activations.serialize(self.activation),
             'use_bias': self.use_bias,
             'kernel_initializer': initializers.serialize(self.kernel_initializer),
             'bias_initializer': initializers.serialize(self.bias_initializer),
             'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
             'bias_regularizer': regularizers.serialize(self.bias_regularizer),
             'activity_regularizer': regularizers.serialize(self.activity_regularizer),
             'kernel_constraint': constraints.serialize(self.kernel_constraint),
             'bias_constraint': constraints.serialize(self.bias_constraint),
             'input_dim': self.input_dim,
             'learnedKernel': self.tied_to.get_weights()[0],
             'input_length': self.input_length}
     config2 = {'layer_inner': {'bias': np.asarray(self.tied_to.get_weights()[1]),
                                'weights': np.asarray(self.tied_to.get_weights()[0]),
                                'class_name': self.tied_to.__class__.__name__,
                                'config': self.tied_to.get_config()}}
     base_config = super(Convolution1D_tied, self).get_config()
     return dict(list(base_config.items()) + list(config.items()) + list(config2.items()))
 def get_config(self):
     config = {'epsilon': self.epsilon,
               'axis': self.axis,
               'gamma_init': initializers.serialize(self.gamma_init),
               'beta_init': initializers.serialize(self.beta_init),
               'gamma_regularizer': regularizers.serialize(self.gamma_regularizer),
               'beta_regularizer': regularizers.serialize(self.gamma_regularizer),
               'group': self.group}
     base_config = super(GroupNormalization, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {
         'alpha_initializer': initializers.serialize(self.alpha_initializer),
         'alpha_regularizer': regularizers.serialize(self.alpha_regularizer),
         'alpha_constraint': constraints.serialize(self.alpha_constraint),
         'beta_initializer': initializers.serialize(self.beta_initializer),
         'beta_regularizer': regularizers.serialize(self.beta_regularizer),
         'beta_constraint': constraints.serialize(self.beta_constraint),
         'shared_axes': self.shared_axes
     }
     base_config = super(ParametricSoftplus, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {'output_dim': self.output_dim,
             'W_initializer':initializers.serialize(self.W_initializer),
             'b_initializer':initializers.serialize(self.W_initializer),
             'activation': activations.serialize(self.activation),
             'W_regularizer': self.W_regularizer.get_config() if self.W_regularizer else None,
             'b_regularizer': self.b_regularizer.get_config() if self.b_regularizer else None,
             'activity_regularizer': self.activity_regularizer.get_config() if self.activity_regularizer else None,
             'W_constraint': self.W_constraint.get_config() if self.W_constraint else None,
             'b_constraint': self.b_constraint.get_config() if self.b_constraint else None,
             'input_dim': self.input_dim}
     base_config = super(SparseFullyConnectedLayer, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {'sigsize': self.sigsize,
               'sig_level': self.sig_level,
               'train_time_lapse': self.train_time_lapse,
               'initial_time_lapse': self.initial_time_lapse,
               'n_units': self.n_units,
               'units': self.units,
               'output_signatures' : self.output_signatures,
               'use_signatures' : self.use_signatures,
               'kernel_initializer': initializers.serialize(self.kernel_initializer),
               'recurrent_initializer': initializers.serialize(self.recurrent_initializer),
               'activation': self.activation.__name__}
     base_config = super(RecurrentSig, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {
         'axis': self.axis,
         'epsilon': self.epsilon,
         'center': self.center,
         'scale': self.scale,
         'beta_initializer': initializers.serialize(self.beta_initializer),
         'gamma_initializer': initializers.serialize(self.gamma_initializer),
         'beta_regularizer': regularizers.serialize(self.beta_regularizer),
         'gamma_regularizer': regularizers.serialize(self.gamma_regularizer),
         'beta_constraint': constraints.serialize(self.beta_constraint),
         'gamma_constraint': constraints.serialize(self.gamma_constraint)
     }
     base_config = super(InstanceNormalization, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #8
0
 def get_config(self):
     config = {'nb_complex': self.nb_complex,
               'filter_delays':self.filter_delays,
               'kernel_initializer': initializers.serialize(self.kernel_initializer),
               'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
               'kernel_constraint': constraints.serialize(self.kernel_constraint)}
     base_config = super(SpatioTemporalFilterComplex, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {
         'a_initializer': initializers.serialize(self.a_initializer),
         'a_regularizer': regularizers.serialize(self.a_regularizer),
         'a_constraint': constraints.serialize(self.a_constraint),
         'k_initializer': initializers.serialize(self.k_initializer),
         'k_regularizer': regularizers.serialize(self.k_regularizer),
         'k_constraint': constraints.serialize(self.k_constraint),
         'n_initializer': initializers.serialize(self.n_initializer),
         'n_regularizer': regularizers.serialize(self.n_regularizer),
         'n_constraint': constraints.serialize(self.n_constraint),
         'z_initializer': initializers.serialize(self.z_initializer),
         'z_regularizer': regularizers.serialize(self.z_regularizer),
         'z_constraint': constraints.serialize(self.z_constraint),
         'shared_axes': self.shared_axes
     }
     base_config = super(Hill, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #10
0
 def get_config(self):
     config = {
         'vv_theta': self.vv,
         'axis': self.axis,
         'momentum': self.momentum,
         'epsilon': self.epsilon,
         'center': self.center,
         'scale': self.scale,
         'beta_initializer': initializers.serialize(self.beta_initializer),
         'gamma_initializer': initializers.serialize(self.gamma_initializer),
         'moving_mean_initializer': initializers.serialize(self.moving_mean_initializer),
         'moving_variance_initializer': initializers.serialize(self.moving_variance_initializer),
         'beta_regularizer': regularizers.serialize(self.beta_regularizer),
         'gamma_regularizer': regularizers.serialize(self.gamma_regularizer),
         'beta_constraint': constraints.serialize(self.beta_constraint),
         'gamma_constraint': constraints.serialize(self.gamma_constraint)
     }
     base_config = super(RProjFWH_BatchNormalization, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #11
0
 def get_config(self):
     config = {
         'filters': self.filters,
         'kernel_size': self.kernel_size,
         'strides': self.strides,
         'padding': self.padding,
         'data_format': self.data_format,
         'activation': activations.serialize(self.activation),
         'use_bias': self.use_bias,
         'kernel_initializer': initializers.serialize(self.kernel_initializer),
         'bias_initializer': initializers.serialize(self.bias_initializer),
         'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
         'bias_regularizer': regularizers.serialize(self.bias_regularizer),
         'activity_regularizer': regularizers.serialize(self.activity_regularizer),
         'kernel_constraint': constraints.serialize(self.kernel_constraint),
         'bias_constraint': constraints.serialize(self.bias_constraint)
     }
     base_config = super(LocallyConnected2D, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = super(DepthwiseConv2D, self).get_config()
     config.pop('filters')
     config.pop('kernel_initializer')
     config.pop('kernel_regularizer')
     config.pop('kernel_constraint')
     config['depth_multiplier'] = self.depth_multiplier
     config['depthwise_initializer'] = initializers.serialize(self.depthwise_initializer)
     config['depthwise_regularizer'] = regularizers.serialize(self.depthwise_regularizer)
     config['depthwise_constraint'] = constraints.serialize(self.depthwise_constraint)
     return config
Exemple #13
0
 def get_config(self):
     config = {'init': initializers.serialize(self.init),
               'activation': activations.serialize(self.activation),
               'W_regularizer': regularizers.serialize(self.W_regularizer),
               'b_regularizer': regularizers.serialize(self.b_regularizer),
               'activity_regularizer': regularizers.serialize(self.activity_regularizer),
               'W_constraint': constraints.serialize(self.W_constraint),
               'b_constraint': constraints.serialize(self.b_constraint),
               'bias': self.bias,
               'input_dim': self.input_dim}
     base_config = super(Highway, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
    def get_config(self):
        config = {
                'alpha_pos_initializer': initializers.serialize(self.alpha_pos_initializer),
                'alpha_neg_initializer': initializers.serialize(self.alpha_neg_initializer),
                'beta_pos_initializer': initializers.serialize(self.beta_pos_initializer),
                'beta_neg_initializer': initializers.serialize(self.beta_neg_initializer),
                'rho_pos_initializer': initializers.serialize(self.rho_pos_initializer),
                'rho_neg_initializer': initializers.serialize(self.rho_neg_initializer),

                'alpha_pos_constraint': constraints.serialize(self.alpha_pos_constraint),
                'alpha_neg_constraint': constraints.serialize(self.alpha_neg_constraint),
                'beta_pos_constraint': constraints.serialize(self.beta_pos_constraint),
                'beta_neg_constraint': constraints.serialize(self.beta_neg_constraint),
                'rho_pos_constraint': constraints.serialize(self.rho_pos_constraint),
                'rho_neg_constraint': constraints.serialize(self.rho_neg_constraint),

                'alpha_pos_regularizer': regularizers.serialize(self.alpha_pos_regularizer),
                'alpha_neg_regularizer': regularizers.serialize(self.alpha_neg_regularizer),
                'beta_pos_regularizer': regularizers.serialize(self.beta_pos_regularizer),
                'beta_neg_regularizer': regularizers.serialize(self.beta_neg_regularizer),
                'rho_pos_regularizer': regularizers.serialize(self.rho_pos_regularizer),
                'rho_neg_regularizer': regularizers.serialize(self.rho_neg_regularizer),
        }
        base_config = super(PowerPReLU, self).get_config()
        return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     """Return the configuration for building the layer."""
     config = dict(
         units=self.units,
         is_first=self.is_first,
         is_last=self.is_last,
         attention_factor=self.attention_factor,
         dropout=self.dropout,
         mean_activation=activations.serialize(self.mean_activation),
         mean_initializer=initializers.serialize(self.mean_initializer),
         mean_regularizer=regularizers.serialize(self.mean_regularizer),
         mean_constraint=constraints.serialize(self.mean_constraint),
         variance_activation=activations.serialize(
             self.variance_activation),
         variance_initializer=initializers.serialize(
             self.variance_initializer),
         variance_regularizer=regularizers.serialize(self.mean_regularizer),
         variance_constraint=constraints.serialize(
             self.variance_constraint),
         last_activation=activations.serialize(self.last_activation),
     )
     # get items from the parent class and combine them with this layer
     base_config = super().get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     # Remember to record all args of the `__init__`
     # which are not covered by `GRUCell`.
     config = {'x_imputation': self.x_imputation,
               'input_decay': serialize_keras_object(self.input_decay),
               'hidden_decay': serialize_keras_object(self.hidden_decay),
               'use_decay_bias': self.use_decay_bias,
               'feed_masking': self.feed_masking,
               'masking_decay': serialize_keras_object(self.masking_decay),
               'decay_initializer': initializers.serialize(self.decay_initializer),
               'decay_regularizer': regularizers.serialize(self.decay_regularizer),
               'decay_constraint': constraints.serialize(self.decay_constraint)
              }
     base_config = super(GRUDCell, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
   config = {
       "num_heads":
           self._num_heads,
       "key_dim":
           self._key_dim,
       "value_dim":
           self._value_dim,
       "dropout":
           self._dropout,
       "use_bias":
           self._use_bias,
       "output_shape":
           self._output_shape,
       "attention_axes":
           self._attention_axes,
       "kernel_initializer":
           initializers.serialize(self._kernel_initializer),
       "bias_initializer":
           initializers.serialize(self._bias_initializer),
       "kernel_regularizer":
           regularizers.serialize(self._kernel_regularizer),
       "bias_regularizer":
           regularizers.serialize(self._bias_regularizer),
       "activity_regularizer":
           regularizers.serialize(self._activity_regularizer),
       "kernel_constraint":
           constraints.serialize(self._kernel_constraint),
       "bias_constraint":
           constraints.serialize(self._bias_constraint),
       "query_shape": self._query_shape,
       "key_shape": self._key_shape,
       "value_shape": self._value_shape,
   }
   base_config = super(MultiHeadAttention, self).get_config()
   return dict(list(base_config.items()) + list(config.items()))
Exemple #18
0
 def get_config(self):
     config = {
         'input_dim':
         self.input_dim,
         'output_dim':
         self.output_dim,
         'embeddings_initializer':
         initializers.serialize(self.embeddings_initializer),
         'embeddings_regularizer':
         regularizers.serialize(self.embeddings_regularizer),
         'embeddings_constraint':
         constraints.serialize(self.embeddings_constraint),
     }
     base_config = super(Embedding2D, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #19
0
 def get_config(self):
     config = {
         'kernel_size': self.kernel_size,
         'num_capsule': self.num_capsule,
         'num_atoms': self.num_atoms,
         'strides': self.strides,
         'padding': self.padding,
         'routings': self.routings,
         'kernel_initializer':
         initializers.serialize(self.kernel_initializer),
         'epsilon': self.epsilon,
         'center': self.center,
         'scale': self.scale,
         'beta_initializer': initializers.serialize(self.beta_initializer),
         'gamma_initializer':
         initializers.serialize(self.gamma_initializer),
         'beta_regularizer': regularizers.serialize(self.beta_regularizer),
         'gamma_regularizer':
         regularizers.serialize(self.gamma_regularizer),
         'beta_constraint': constraints.serialize(self.beta_constraint),
         'gamma_constraint': constraints.serialize(self.gamma_constraint)
     }
     base_config = super(ConvCapsuleLayer, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #20
0
 def get_config(self):
     config = {
         'init': initializers.serialize(self.init),
         'U_regularizer': regularizers.serialize(self.U_regularizer),
         'b_start_regularizer':
         regularizers.serialize(self.b_start_regularizer),
         'b_end_regularizer':
         regularizers.serialize(self.b_end_regularizer),
         'U_constraint': constraints.serialize(self.U_constraint),
         'b_start_constraint':
         constraints.serialize(self.b_start_constraint),
         'b_end_constraint': constraints.serialize(self.b_end_constraint)
     }
     base_config = super(ChainCRF, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #21
0
 def get_config(self):
     config = {
         'input_dim':
         self.input_dim,
         'output_dim':
         self.output_dim,
         'merge_mode':
         self.merge_mode,
         'embeddings_initializer':
         initializers.serialize(self.embeddings_initializer),
         'custom_position_ids':
         self.custom_position_ids,
     }
     base_config = super(PositionEmbedding, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #22
0
 def get_config(self):
     config = {
         'activation':
         activations.serialize(self.activation),
         'bias_initializer':
         initializers.serialize(self.bias_initializer),
         'bias_regularizer':
         regularizers.serialize(self.bias_regularizer),
         'activity_regularizer':
         regularizers.serialize(self.activity_regularizer),
         'bias_constraint':
         constraints.serialize(self.bias_constraint)
     }
     base_config = super(Bias, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #23
0
    def get_config(self):
        config = super(DepthwiseConv2D, self).get_config()
        config.pop('filters')
        config.pop('kernel_initializer')
        config.pop('kernel_regularizer')
        config.pop('kernel_constraint')
        config['depth_multiplier'] = self.depth_multiplier
        config['depthwise_initializer'] = initializers.serialize(
            self.depthwise_initializer)
        config['depthwise_regularizer'] = regularizers.serialize(
            self.depthwise_regularizer)
        config['depthwise_constraint'] = constraints.serialize(
            self.depthwise_constraint)

        return config
Exemple #24
0
 def get_config(self):
     config = {
         'heads': self.heads,
         'head_size': self.head_size,
         'out_dim': self.out_dim,
         'key_size': self.key_size,
         'use_bias': self.use_bias,
         'attention_scale': self.attention_scale,
         'attention_dropout': self.attention_dropout,
         'return_attention_scores': self.return_attention_scores,
         'kernel_initializer':
             initializers.serialize(self.kernel_initializer),
     }
     base_config = super(MultiHeadAttention, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #25
0
    def get_config(self):
        """
        Gets class configuration for Keras serialization.
        Used by keras model serialization.

        Returns:
            A dictionary that contains the config of the layer
        """

        config = {
            "units":
            self.units,
            "use_bias":
            self.use_bias,
            "support":
            self.support,
            "activation":
            activations.serialize(self.activation),
            "kernel_initializer":
            initializers.serialize(self.kernel_initializer),
            "bias_initializer":
            initializers.serialize(self.bias_initializer),
            "kernel_regularizer":
            regularizers.serialize(self.kernel_regularizer),
            "bias_regularizer":
            regularizers.serialize(self.bias_regularizer),
            "activity_regularizer":
            regularizers.serialize(self.activity_regularizer),
            "kernel_constraint":
            constraints.serialize(self.kernel_constraint),
            "bias_constraint":
            constraints.serialize(self.bias_constraint),
        }

        base_config = super().get_config()
        return {**base_config, **config}
Exemple #26
0
    def get_config(self):
        """
        To serialize the model given and generate all related parameters
        Returns
        -------

        """
        config = {'kernel_initializer': initializers.serialize(self.kernel_initializer),
                  'activation': self.activation.__name__,
                  'dim_ordering': self.dim_ordering,
                  'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
                  'eps': self.eps,
                  'cov_mode': self.cov_mode
                  }
        base_config = super(SecondaryStatistic, self).get_config()
        return dict(list(base_config.items()) + list(config.items()))
Exemple #27
0
    def get_config(self):
        config = super(myDense, self).get_config()
        config.update({
            "units":
            self.units,
            "activation":
            activations.serialize(self.activation),
            "bias":
            self.bias,
            "weight_initializer":
            initializers.serialize(self.weight_initializer),
            "weight_regularizer":
            regularizers.serialize(self.weight_regularizer),
        })

        return config
Exemple #28
0
 def get_config(self):
     config = {
         'activation': activations.serialize(self.activation),
         'W_initializer': initializers.serialize(self.W_initializer),
         'W1_regularizer': regularizers.serialize(self.W1_regularizer),
         'W2_regularizer': regularizers.serialize(self.W2_regularizer),
         'W1_constraint': constraints.serialize(self.W1_constraint),
         'W2_constraint': constraints.serialize(self.W2_constraint),
         'da': self.da,
         'r': self.r,
         'return_attention': self.return_attention,
         'attention_regularizer_weight': self.attention_regularizer_weight,
         'hidden': self.hidden
     }
     base_config = super(Attention, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {
         'kernel_size': self.kernel_size,
         'num_capsule': self.num_capsule,
         'num_atoms': self.num_atoms,
         'strides': self.strides,
         'padding': self.padding,
         'routings': self.routings,
         'kernel_initializer':
         initializers.serialize(self.kernel_initializer),
         'squash': self.squash,
         'squash_activation': self.squash_activation,
         'individual_kernels_per_type': self.individual_kernels_per_type
     }
     base_config = super(ConvCapsuleLayer, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {'filters': self.filters,
               'kernel_size': self.kernel_size,
               'kernel_initializer': initializers.serialize(self.kernel_initializer),
               'activation': activations.serialize(self.activation),
               'padding': self.padding,
               'strides': self.strides,
               'data_format': self.data_format,
               'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
               'bias_regularizer': regularizers.serialize(self.bias_regularizer),
               'activity_regularizer': regularizers.serialize(self.activity_regularizer),
               'kernel_constraint': constraints.serialize(self.kernel_constraint),
               'bias_constraint': constraints.serialize(self.bias_constraint),
               'use_bias': self.use_bias}
     base_config = super(CosineConvolution2D, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #31
0
 def get_config(self):
     config = {
         'k':
         self.k,
         'channels':
         self.channels,
         'kernel_initializer':
         initializers.serialize(self.kernel_initializer),
         'kernel_regularizer':
         regularizers.serialize(self.kernel_regularizer),
         'activity_regularizer':
         regularizers.serialize(self.activity_regularizer),
         'kernel_constraint':
         constraints.serialize(self.kernel_constraint),
     }
     base_config = super(DiffPool, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #32
0
 def get_config(self):
     config = {
         'ratio':
         self.ratio,
         'return_mask':
         self.return_mask,
         'kernel_initializer':
         initializers.serialize(self.kernel_initializer),
         'kernel_regularizer':
         regularizers.serialize(self.kernel_regularizer),
         'activity_regularizer':
         regularizers.serialize(self.activity_regularizer),
         'kernel_constraint':
         constraints.serialize(self.kernel_constraint),
     }
     base_config = super(TopKPool, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #33
0
 def get_config(self):
     config = {
         'beta_initializer':
         initializers.serialize(self.beta_initializer),
         'beta_regularizer':
         regularizers.serialize(self.beta_regularizer),
         'beta_constraint':
         constraints.serialize(self.beta_constraint),
         'norm_axis':
         self.norm_axis,
         'signal_regularizer':
         regularizers.serialize(self.output_regularizers[0]),
         'diss_regularizer':
         regularizers.serialize(self.output_regularizers[1])
     }
     super_config = super(GibbsRouting, self).get_config()
     return dict(list(super_config.items()) + list(config.items()))
Exemple #34
0
 def get_config(self):
   config = {
       'input_dim': self.input_dim,
       'output_dim': self.output_dim,
       'embeddings_initializer':
           initializers.serialize(self.embeddings_initializer),
       'embeddings_regularizer':
           regularizers.serialize(self.embeddings_regularizer),
       'activity_regularizer':
           regularizers.serialize(self.activity_regularizer),
       'embeddings_constraint':
           constraints.serialize(self.embeddings_constraint),
       'mask_zero': self.mask_zero,
       'input_length': self.input_length
   }
   base_config = super(Embedding, self).get_config()
   return dict(list(base_config.items()) + list(config.items()))
Exemple #35
0
 def get_config(self):
     config = {
         'units': self.units,
         'activation': activations.serialize(self.activation),
         'use_bias': self.use_bias,
         'kernel_initializer':
         initializers.serialize(self.kernel_initializer),
         # 'bias_initializer': initializers.serialize(self.bias_initializer),
         'kernel_regularizer':
         regularizers.serialize(self.kernel_regularizer),
         # 'bias_regularizer': regularizers.serialize(self.bias_regularizer),
         # 'activity_regularizer': regularizers.serialize(self.activity_regularizer),
         # 'kernel_constraint': constraints.serialize(self.kernel_constraint),
         # 'bias_constraint': constraints.serialize(self.bias_constraint)
     }
     base_config = super(GraphConvolution, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {
         'axes':
         self.axes,
         'scope':
         self.scope,
         'linear_map_initializer':
         initializers.serialize(self.bias_initializer),
         'linear_map_regularizer':
         regularizers.serialize(self.bias_regularizer),
         'linear_map_constraint':
         constraints.serialize(self.bias_constraint),
         'signal_regularizer':
         regularizers.serialize(self.output_regularizers[0])
     }
     super_config = super(AddBias, self).get_config()
     return dict(list(super_config.items()) + list(config.items()))
Exemple #37
0
 def get_config(self):
     config = {
         'ch_j': self.ch_j,
         'n_j': self.n_j,
         'kernel_size': self.kernel_size,
         'strides': self.strides,
         'b_alphas': self.b_alphas,
         'padding': self.padding,
         'data_format': self.data_format,
         'dilation_rate': self.dilation_rate,
         'kernel_initializer': initializers.serialize(self.kernel_initializer),
         'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
         'activity_regularizer': regularizers.serialize(self.activity_regularizer),
         'kernel_constraint': constraints.serialize(self.kernel_constraint)
     }
     base_config = super(Conv2DCaps, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {
         'output_dim':
         self.output_dim,
         'axis':
         self.axis,
         'scope':
         self.scope,
         'linear_map_initializer':
         initializers.serialize(self.linear_map_initializer),
         'linear_map_regularizer':
         regularizers.serialize(self.linear_map_regularizer),
         'linear_map_constraint':
         constraints.serialize(self.linear_map_constraint)
     }
     super_config = super(LinearTransformation, self).get_config()
     return dict(list(super_config.items()) + list(config.items()))
Exemple #39
0
 def get_config(self):
     """Returns the config of the layer.
     A layer config is a Python dictionary (serializable)
     containing the configuration of a layer.
     The same layer can be reinstantiated later
     (without its trained weights) from this configuration.
     The config of a layer does not include connectivity
     information, nor the layer class name. These are handled
     by `Network` (one layer of abstraction above).
     # Returns
         Python dictionary.
     """
     config = {
         'size': self.size,
         'initializer': initializers.serialize(self.initializer),
         'regularizer': regularizers.serialize(self.regularizer)
     }
     base_config = Layer.get_config(self)
     return dict(list(base_config.items()) + list(config.items()))
Exemple #40
0
 def get_config(self):
     config = {
         "units":
         self.units,
         "activation":
         activations.serialize(self.activation),
         "kernel_initializer":
         initializers.serialize(self.kernel_initializer),
         "kernel_regularizer":
         regularizers.serialize(self.kernel_regularizer),
         "activity_regularizer":
         regularizers.serialize(self.activity_regularizer),
         "kernel_constraint":
         constraints.serialize(self.kernel_constraint),
         'num_bits':
         num_bits
     }
     base_config = super(QuantizedDense, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #41
0
 def get_config(self):
     config = {
         'prototype_initializer':
         initializers.serialize(self.prototype_initializer),
         'prototype_regularizer':
         regularizers.serialize(self.prototype_regularizer),
         'prototype_constraint':
         constraints.serialize(self.prototype_constraint),
         'signal_output':
         self.signal_output,
         'linear_factor':
         self.linear_factor,
         'signal_regularizer':
         regularizers.serialize(self.output_regularizers[0]),
         'diss_regularizer':
         regularizers.serialize(self.output_regularizers[1])
     }
     super_config = super(PointPrototype, self).get_config()
     return dict(list(super_config.items()) + list(config.items()))
 def get_config(self):
     config = {
         'kernel_size': self.kernel_size,
         'filters': self.filters,
         'num_capsule': self.num_capsule,
         'strides': self.strides,
         'padding': self.padding,
         'routings': self.routings,
         'kernel_initializer':
         initializers.serialize(self.kernel_initializer),
         'activation_fn': self.activation_fn,
         'agreement': self.agreement,
         'emphasis': self.emphasis,
         'return_route_last': self.return_route_last,
         'reverse_routing': self.reverse_routing,
         'shared_child': self.shared_child,
         'shared_parent': self.shared_parent
     }
     base_config = super(ConvGlobalLocalCapsuleLayer, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
 def get_config(self):
     config = {
         'output_dim':
         self.output_dim,
         'init':
         initializers.serialize(self.init),
         'nb_feature':
         self.nb_feature,
         'b_regularizer':
         regularizers.serialize(self.b_regularizer),
         'activity_regularizer':
         regularizers.serialize(self.activity_regularizer),
         'b_constraint':
         constraints.serialize(self.b_constraint),
         'bias':
         self.bias,
         'input_dim':
         self.input_dim
     }
     base_config = super(MaxoutDense, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
Exemple #44
0
 def get_config(self):
     config = {
         'ch_j':
         self.ch_j,
         'n_j':
         self.n_j,
         'r_num':
         self.r_num,
         'b_alphas':
         self.b_alphas,
         'kernel_initializer':
         initializers.serialize(self.kernel_initializer),
         'kernel_regularizer':
         regularizers.serialize(self.kernel_regularizer),
         'activity_regularizer':
         regularizers.serialize(self.activity_regularizer),
         'kernel_constraint':
         constraints.serialize(self.kernel_constraint),
     }
     base_config = super(DenseCaps, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))