コード例 #1
0
def tf_keras_model(data):
    x, y = data
    model = TfSequential()
    model.add(TfDense(3, input_dim=4))
    model.add(TfDense(1))
    model.compile(loss="mean_squared_error", optimizer=TfSGD())
    model.fit(x, y)
    return model
コード例 #2
0
def tf_keras_model(data):
    x, y = data
    model = TfSequential()
    model.add(TfDense(3, input_dim=4))
    model.add(TfDense(1))
    model.compile(loss="mean_squared_error", optimizer=TfSGD(learning_rate=0.001))
    model.fit(x.values, y.values)
    return model
コード例 #3
0
def tf_keras_model(data):
    x, y = data
    from tensorflow.keras.models import Sequential as TfSequential
    from tensorflow.keras.layers import Dense as TfDense
    model = TfSequential()
    model.add(TfDense(3, input_dim=4))
    model.add(TfDense(1))
    model.compile(loss='mean_squared_error', optimizer='SGD')
    model.fit(x, y)
    return model