def __init__(self, axis=0, **kwargs): super().__init__(**kwargs) self.axis = axis self.input_spec = [ InputSpec(dtype='int32'), InputSpec(dtype=K.floatx()) ]
def __init__(self, upsampling, name='', **kwargs): self.name = name self.upsampling = upsampling self.channels = None self.input_spec = [InputSpec(ndim=4)] super(BilinearUpsampling, self).__init__(**kwargs)
def __init__(self, downsampling_factor=10, init='glorot_uniform', activation='linear', weights=None, W_regularizer=None, activity_regularizer=None, W_constraint=None, input_dim=None, **kwargs): self.downsampling_factor = downsampling_factor self.init = initializations.get(init) self.activation = activations.get(activation) self.W_regularizer = regularizers.get(W_regularizer) self.activity_regularizer = regularizers.get(activity_regularizer) self.W_constraint = constraints.get(W_constraint) self.initial_weights = weights self.input_dim = input_dim if self.input_dim: kwargs['input_shape'] = (self.input_dim, ) self.input_spec = [InputSpec(ndim=4)] super(EltWiseProduct, self).__init__(**kwargs)
def build(self, input_shape): self.input_spec = [ InputSpec(dtype=K.floatx(), shape=(None, ) + input_shape[1:]) ] self.activity_in_bounds.set_layer(self) self.regularizers = [self.activity_in_bounds] super().build(input_shape)
def __init__(self, padding=1, mode='CONSTANT', constant_values=0, **kwargs): super(type(self), self).__init__(**kwargs) self.padding = normalize_tuple(padding, 2, 'padding') self.mode = mode self.constant_values = constant_values self.input_spec = InputSpec(ndim=3)
def __init__(self, upsampling, input_dim=None, name='', **kwargs): self.name = name self.upsampling = upsampling self.channels = None self.input_dim = input_dim if self.input_dim: kwargs['input_shape'] = (self.input_dim, ) self.input_spec = [InputSpec(ndim=4)] super(BilinearUpsampling, self).__init__(**kwargs)
def __init__(self, upsampling=(2, 2), output_size=None, data_format=None, **kwargs): super(BilinearUpsampling, self).__init__(**kwargs) self.data_format = normalize_data_format(data_format) self.input_spec = InputSpec(ndim=4) if output_size: self.output_size = conv_utils.normalize_tuple( output_size, 2, 'output_size') self.upsampling = None else: self.output_size = None self.upsampling = conv_utils.normalize_tuple( upsampling, 2, 'upsampling')
def build(self, input_shape): self.input_spec = [InputSpec(ndim=4), InputSpec(ndim=2)]