Type DenseFeatures
Namespace tensorflow.keras.layers
Parent _BaseFeaturesLayer
Interfaces IDenseFeatures
A layer that produces a dense `Tensor` based on given `feature_columns`. Generally a single example in training data is described with FeatureColumns.
At the first layer of the model, this column oriented data should be converted
to a single `Tensor`. This layer can be called multiple times with different features. This is the V1 version of this layer that uses variable_scope's to create
variables which works well with PartitionedVariables. Variable scopes are
deprecated in V2, so the V2 version uses name_scopes instead. But currently
that lacks support for partitioned variables. Use this if you need
partitioned variables. Example:
Show Example
price = numeric_column('price') keywords_embedded = embedding_column( categorical_column_with_hash_bucket("keywords", 10K), dimensions=16) columns = [price, keywords_embedded,...] feature_layer = DenseFeatures(columns) features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) dense_tensor = feature_layer(features) for units in [128, 64, 32]: dense_tensor = tf.compat.v1.keras.layers.Dense( units, activation='relu')(dense_tensor) prediction = tf.compat.v1.keras.layers.Dense(1)(dense_tensor)
Properties
- activity_regularizer
- activity_regularizer_dyn
- built
- dtype
- dtype_dyn
- dynamic
- dynamic_dyn
- inbound_nodes
- inbound_nodes_dyn
- input
- input_dyn
- input_mask
- input_mask_dyn
- input_shape
- input_shape_dyn
- input_spec
- input_spec_dyn
- losses
- losses_dyn
- metrics
- metrics_dyn
- name
- name_dyn
- name_scope
- name_scope_dyn
- non_trainable_variables
- non_trainable_variables_dyn
- non_trainable_weights
- non_trainable_weights_dyn
- outbound_nodes
- outbound_nodes_dyn
- output
- output_dyn
- output_mask
- output_mask_dyn
- output_shape
- output_shape_dyn
- PythonObject
- stateful
- submodules
- submodules_dyn
- supports_masking
- trainable
- trainable_dyn
- trainable_variables
- trainable_variables_dyn
- trainable_weights
- trainable_weights_dyn
- updates
- updates_dyn
- variables
- variables_dyn
- weights
- weights_dyn