brainpy.algorithms.offline.ElasticNetRegression#

class brainpy.algorithms.offline.ElasticNetRegression(alpha=1.0, degree=2, l1_ratio=0.5, name=None, add_bias=False, max_iter=1000, learning_rate=0.001, gradient_descent=True)[source]#
degree: int

The degree of the polynomial that the independent variable X will be transformed to.

reg_factor: float

The factor that will determine the amount of regularization and feature shrinkage.

l1_ration: float

Weighs the contribution of l1 and l2 regularization.

n_iterations: float

The number of training iterations the algorithm will tune the weights for.

learning_rate: float

The step length that will be used when updating the weights.

__init__(alpha=1.0, degree=2, l1_ratio=0.5, name=None, add_bias=False, max_iter=1000, learning_rate=0.001, gradient_descent=True)[source]#

Methods

__init__([alpha, degree, l1_ratio, name, ...])

call(identifier, targets, inputs[, outputs])

The training procedure.

gradient_descent_solve(targets, inputs[, ...])

init_weights(n_features, n_out)

Initialize weights randomly [-1/N, 1/N]

initialize(identifier, *args, **kwargs)

load_states(filename[, verbose])

Load the model states.

nodes([method, level, include_self])

Collect all children nodes.

predict(W, X)

register_implicit_nodes(*nodes, **named_nodes)

register_implicit_vars(*variables, ...)

save_states(filename[, variables])

Save the model states.

train_vars([method, level, include_self])

The shortcut for retrieving all trainable variables.

unique_name([name, type_])

Get the unique name for this object.

vars([method, level, include_self])

Collect all variables in this node and the children nodes.

Attributes

name

Name of the model.