コード例 #1
0
ファイル: clstm.py プロジェクト: sp-uhh/compressed-lstm
 def get_config(self):
     config = {'units': self.units,
               'rank': self.rank,
               'activation': activations.serialize(self.activation),
               'recurrent_activation':
                   activations.serialize(self.recurrent_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),
               '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),
               '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),
               'dropout': self.dropout,
               'recurrent_dropout': self.recurrent_dropout,
               'implementation': self.implementation}
     base_config = super(CLSTM, self).get_config()
     del base_config['cell']
     return dict(list(base_config.items()) + list(config.items()))
コード例 #2
0
 def get_config(self):
     config = {
         'activation':
         activations.serialize(self.activation),
         'recurrent_activation':
         activations.serialize(self.recurrent_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),
         'kernel_regularizer':
         regularizers.serialize(self.kernel_regularizer),
         'recurrent_regularizer':
         regularizers.serialize(self.recurrent_regularizer),
         'bias_regularizer':
         regularizers.serialize(self.bias_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)
     }
     base_config = super(ExtendedRNNCell, self).get_config()
     config.update(base_config)
     return config
コード例 #3
0
ファイル: set2set.py プロジェクト: 2013311026/megnet
    def get_config(self):
        config = {"T": self.T,
                  "n_hidden": self.n_hidden,
                  "activation": activations.serialize(self.activation),
                  "activation_lstm": activations.serialize(
                      self.activation_lstm),
                  "recurrent_activation": activations.serialize(
                      self.recurrent_activation),
                  "kernel_initializer": initializers.serialize(
                      self.kernel_initializer),
                  "recurrent_initializer": initializers.serialize(
                      self.recurrent_initializer),
                  "bias_initializer": initializers.serialize(
                      self.bias_initializer),
                  "use_bias": self.use_bias,
                  "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),
                  "kernel_constraint": constraints.serialize(
                      self.kernel_constraint),
                  "recurrent_constraint": constraints.serialize(
                      self.recurrent_constraint),
                  "bias_constraint": constraints.serialize(self.bias_constraint)

                  }
        base_config = super(Set2Set, self).get_config()
        return dict(list(base_config.items()) + list(config.items()))
コード例 #4
0
ファイル: SpatialGRU.py プロジェクト: hhh920406/MatchZoo
 def get_config(self):
     config = {
         'channel': self.channel,
         'normalize': self.normalize,
         'init_diag': self.init_diag,
         'activation': activations.serialize(self.activation),
         'recurrent_activation': activations.serialize(self.recurrent_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)
     }
     base_config = super(SpatialGRU, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
コード例 #5
0
 def get_config(self):
     config = {
         'units':
         self.units,
         'activation':
         activations.serialize(self.activation),
         'recurrent_activation':
         activations.serialize(self.recurrent_activation),
         'attention_activation':
         activations.serialize(self.attention_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),
         'attention_initializer':
         initializers.serialize(self.attention_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),
         'activity_regularizer':
         regularizers.serialize(self.activity_regularizer),
         'attention_regularizer':
         regularizers.serialize(self.attention_regularizer),
         'kernel_constraint':
         constraints.serialize(self.kernel_constraint),
         'recurrent_constraint':
         constraints.serialize(self.recurrent_constraint),
         'bias_constraint':
         constraints.serialize(self.bias_constraint),
         'attention_constraint':
         constraints.serialize(self.attention_constraint),
         'dropout':
         self.dropout,
         'recurrent_dropout':
         self.recurrent_dropout,
         'return_attention':
         self.return_attention
     }
     base_config = super(AttentionLSTM, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
コード例 #6
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(MDense, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
コード例 #7
0
ファイル: graph.py プロジェクト: wangvei/megnet
    def get_config(self):
        """
        Part of keras layer interface, where the signature is converted into a dict
        :return:
        """
        config = {
            '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().get_config()
        return dict(list(base_config.items()) + list(config.items()))
コード例 #8
0
 def get_config(self):
     config = {
         'activation': activations.serialize(self.activation),
         'use_bias': self.use_bias,
         'bias_initializer': initializers.serialize(self.bias_initializer),
         'bias_regularizer': regularizers.serialize(self.bias_regularizer),
     }
     base_config = super(OutputLayer, self).get_config()
     return dict(**base_config, **config)
コード例 #9
0
ファイル: attention_decoder_f.py プロジェクト: vladiH/chatbot
 def get_config(self):
     config = {
         'units':
         self.units,
         'steps':
         self.steps,
         'output_dim':
         self.output_dim,
         'atten_units':
         self.atten_units,
         'activation':
         activations.serialize(self.activation),
         'gmax':
         self.gmax,
         'recurrent_activation':
         activations.serialize(self.recurrent_activation),
         'kernel_initializer':
         initializers.serialize(self.kernel_initializer),
         'recurrent_initializer':
         initializers.serialize(self.recurrent_initializer),
         'bias_initializer':
         initializers.serialize(self.bias_initializer),
         'kernel_regularizer':
         regularizers.serialize(self.kernel_regularizer),
         'recurrent_regularizer':
         regularizers.serialize(self.recurrent_regularizer),
         'bias_regularizer':
         regularizers.serialize(self.bias_regularizer),
         'kernel_constraint':
         constraints.serialize(self.kernel_constraint),
         'recurrent_constraint':
         constraints.serialize(self.recurrent_constraint),
         'bias_constraint':
         constraints.serialize(self.bias_constraint),
         'dropout':
         self.dropout,
         'recurrent_dropout':
         self.recurrent_dropout,
         'return_probabilities':
         self.return_probabilities
     }
     base_config = super(attention_LSTM, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
コード例 #10
0
 def get_config(self):
     config = {
         'units':
         self.units,
         'activation':
         activations.serialize(self.activation),
         'recurrent_activation':
         activations.serialize(self.recurrent_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),
         'kernel_regularizer':
         regularizers.serialize(self.kernel_regularizer),
         'recurrent_regularizer':
         regularizers.serialize(self.recurrent_regularizer),
         'bias_regularizer':
         regularizers.serialize(self.bias_regularizer),
         'kernel_constraint':
         constraints.serialize(self.kernel_constraint),
         'recurrent_constraint':
         constraints.serialize(self.recurrent_constraint),
         'bias_constraint':
         constraints.serialize(self.bias_constraint),
         'dropout':
         self.dropout,
         'recurrent_dropout':
         self.recurrent_dropout,
         'implementation':
         self.implementation,
         'reset_after':
         self.reset_after
     }
     base_config = super(mlpGRUCell, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
コード例 #11
0
ファイル: SpatialGRU.py プロジェクト: dunglason6789p/QA_VN
 def get_config(self):
     config = {
         'channel':
         self.channel,
         'normalize':
         self.normalize,
         'init_diag':
         self.init_diag,
         'activation':
         activations.serialize(self.activation),
         'recurrent_activation':
         activations.serialize(self.recurrent_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)
     }
     base_config = super(SpatialGRU, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
コード例 #12
0
ファイル: custom_layers.py プロジェクト: mHealthBuet/heartnet
 def get_config(self):
     config = {
         'rank': self.rank,
         '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,
         'fsHz': self.fsHz,
         'fc_initializer': initializers.serialize(self.fc_initializer),
         'n_order_initializer': initializers.serialize(self.n_order_initializer),
         'amp_initializer': initializers.serialize(self.amp_initializer),
         'beta_initializer': initializers.serialize(self.beta_initializer),
         'bias_initializer': initializers.serialize(self.bias_initializer),
     }
     base_config = super(Conv1D_gammatone, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
コード例 #13
0
ファイル: custom_layers.py プロジェクト: mHealthBuet/heartnet
 def get_config(self):
     config = {
         'rank': self.rank,
         '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)
     }
     base_config = super(Conv1D_linearphaseType, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))
コード例 #14
0
 def get_config(self):
     config = super().get_config()
     config['activation'] = activations.serialize(self.activation)
     config['size_multiplier'] = self.size_multiplier
     return config
コード例 #15
0
 def get_config(self):
     config = {"activation": activations.serialize(self.activation)}
     base_config = super(TiedEmbeddingsTransposed, self).get_config()
     return dict(list(base_config.items()) + list(config.items()))