Skip to content

Commit

Permalink
Merge pull request #16447 from gadagashwini:patch-3
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 443804519
  • Loading branch information
tensorflower-gardener committed Apr 23, 2022
2 parents b6087bf + 0b05419 commit 9613004
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keras/premade_models/wide_deep.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class WideDeepModel(keras_training.Model):
dnn_model = keras.Sequential([keras.layers.Dense(units=64),
keras.layers.Dense(units=1)])
combined_model = WideDeepModel(linear_model, dnn_model)
combined_model.compile(optimizer=['sgd', 'adam'], 'mse', ['mse'])
combined_model.compile(optimizer=['sgd', 'adam'], loss='mse', metrics=['mse'])
# define dnn_inputs and linear_inputs as separate numpy arrays or
# a single numpy array if dnn_inputs is same as linear_inputs.
combined_model.fit([linear_inputs, dnn_inputs], y, epochs)
Expand All @@ -64,7 +64,7 @@ class WideDeepModel(keras_training.Model):
dnn_model.compile('rmsprop', 'mse')
dnn_model.fit(dnn_inputs, y, epochs)
combined_model = WideDeepModel(linear_model, dnn_model)
combined_model.compile(optimizer=['sgd', 'adam'], 'mse', ['mse'])
combined_model.compile(optimizer=['sgd', 'adam'], loss='mse', metrics=['mse'])
combined_model.fit([linear_inputs, dnn_inputs], y, epochs)
```
Expand Down

0 comments on commit 9613004

Please sign in to comment.