Type WideDeepModel
Namespace tensorflow.keras.experimental
Parent Model
Interfaces IWideDeepModel
Wide & Deep Model for regression and classification problems. This model jointly train a linear and a dnn model. Example:
Both linear and dnn model can be pre-compiled and trained separately
before jointly training: Example:
Show Example
linear_model = LinearModel()
dnn_model = keras.Sequential([keras.layers.Dense(units=64),
keras.layers.Dense(units=1)])
combined_model = WideDeepModel(dnn_model, linear_model)
combined_model.compile(optimizer=['sgd', 'adam'], 'mse', ['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([dnn_inputs, linear_inputs], y, epochs)
# or define a single tf.data.Dataset
that contains a single tensor or
# separate tensors for dnn_inputs and linear_inputs.
dataset = tf.data.Dataset.from_tensors(([dnn_inputs, linear_inputs], y))
combined_model.fit(dataset, epochs)
Properties
- activation
- activity_regularizer
- activity_regularizer_dyn
- built
- dnn_model
- dtype
- dtype_dyn
- dynamic
- dynamic_dyn
- inbound_nodes
- inbound_nodes_dyn
- input
- input_dyn
- input_mask
- input_mask_dyn
- input_names
- input_shape
- input_shape_dyn
- input_spec
- input_spec_dyn
- inputs
- layers
- layers_dyn
- linear_model
- loss
- loss_functions
- loss_weights
- losses
- losses_dyn
- metrics
- metrics_dyn
- metrics_names
- metrics_names_dyn
- name
- name_dyn
- name_scope
- name_scope_dyn
- non_trainable_variables
- non_trainable_variables_dyn
- non_trainable_weights
- non_trainable_weights_dyn
- optimizer
- outbound_nodes
- outbound_nodes_dyn
- output
- output_dyn
- output_mask
- output_mask_dyn
- output_names
- output_shape
- output_shape_dyn
- outputs
- predict_function
- PythonObject
- run_eagerly
- run_eagerly_dyn
- sample_weight_mode
- sample_weights
- sample_weights_dyn
- state_updates
- state_updates_dyn
- stateful
- stateful_dyn
- submodules
- submodules_dyn
- supports_masking
- test_function
- total_loss
- train_function
- trainable
- trainable_dyn
- trainable_variables
- trainable_variables_dyn
- trainable_weights
- trainable_weights_dyn
- updates
- updates_dyn
- variables
- variables_dyn
- weights
- weights_dyn