Type LinearModel
Namespace tensorflow.keras.experimental
Parent Model
Interfaces ILinearModel
Linear Model for regression and classification problems. This model approximates the following function:
$$y = \beta + \sum_{i=1}^{N} w_{i} * x_{i}$$
where $$\beta$$ is the bias and $$w_{i}$$ is the weight for each feature. Example:
This model accepts sparse float inputs as well: Example:
Show Example
model = LinearModel() model.compile(optimizer='sgd', loss='mse') model.fit(x, y, epochs)
Methods
Properties
- activation
- activity_regularizer
- activity_regularizer_dyn
- bias
- bias_initializer
- bias_regularizer
- built
- dense_layers
- 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
- kernel_initializer
- kernel_regularizer
- layers
- layers_dyn
- 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
- units
- updates
- updates_dyn
- use_bias
- variables
- variables_dyn
- weights
- weights_dyn
Public static methods
LinearModel NewDyn(ImplicitContainer<T> units, object activation, ImplicitContainer<T> use_bias, ImplicitContainer<T> kernel_initializer, ImplicitContainer<T> bias_initializer, object kernel_regularizer, object bias_regularizer, IDictionary<string, object> kwargs)
Create a Linear Model.
Parameters
-
ImplicitContainer<T>
units - Positive integer, output dimension without the batch size.
-
object
activation - Activation function to use. If you don't specify anything, no activation is applied.
-
ImplicitContainer<T>
use_bias - whether to calculate the bias/intercept for this model. If set to False, no bias/intercept will be used in calculations, e.g., the data is already centered.
-
ImplicitContainer<T>
kernel_initializer - Initializer for the `kernel` weights matrices.
-
ImplicitContainer<T>
bias_initializer - Initializer for the bias vector.
-
object
kernel_regularizer - regularizer for kernel vectors.
-
object
bias_regularizer - regularizer for bias vector.
-
IDictionary<string, object>
kwargs - The keyword arguments that are passed on to BaseLayer.__init__.