

def build(self, input_shape):
    assert (len(input_shape) == 2)
    input_dim = input_shape[1]
    self.input_spec = [InputSpec(dtype=K.floatx(), shape=(None, input_dim))]
    self.W = self.init((input_dim, self.output_dim), name='{}_W'.format(self.name))
    if self.bias:
        self.b = K.zeros((self.output_dim,), name='{}_b'.format(self.name))
        self.trainable_weights = [self.W, self.b]
    else:
        self.trainable_weights = [self.W]
    self.regularizers = []
    if self.W_regularizer:
        self.W_regularizer.set_param(self.W)
        self.regularizers.append(self.W_regularizer)
    if (self.bias and self.b_regularizer):
        self.b_regularizer.set_param(self.b)
        self.regularizers.append(self.b_regularizer)
    if self.activity_regularizer:
        self.activity_regularizer.set_layer(self)
        self.regularizers.append(self.activity_regularizer)
    self.constraints = {
        
    }
    if self.W_constraint:
        self.constraints[self.W] = self.W_constraint
    if (self.bias and self.b_constraint):
        self.constraints[self.b] = self.b_constraint
    if (self.initial_weights is not None):
        self.set_weights(self.initial_weights)
        del self.initial_weights

dataset/ETHPy150Open fchollet/keras/keras/layers/core.py Dense.build/original