Class: BernoulliRBM

Bernoulli Restricted Boltzmann Machine (RBM).

A Restricted Boltzmann Machine with binary visible units and binary hidden units. Parameters are estimated using Stochastic Maximum Likelihood (SML), also known as Persistent Contrastive Divergence (PCD) [2].

The time complexity of this implementation is O(d \*\* 2) assuming d ~ n_features ~ n_components.

Read more in the User Guide.

Python Reference

Constructors

new BernoulliRBM()

new BernoulliRBM(opts?): BernoulliRBM

Parameters

ParameterTypeDescription
opts?object-
opts.batch_size?numberNumber of examples per minibatch.
opts.learning_rate?numberThe learning rate for weight updates. It is highly recommended to tune this hyper-parameter. Reasonable values are in the 10**[0., -3.] range.
opts.n_components?numberNumber of binary hidden units.
opts.n_iter?numberNumber of iterations/sweeps over the training dataset to perform during training.
opts.random_state?numberDetermines random number generation for:
opts.verbose?numberThe verbosity level. The default, zero, means silent mode. Range of values is [0, inf].

Returns BernoulliRBM

Defined in generated/neural_network/BernoulliRBM.ts:27

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/neural_network/BernoulliRBM.ts:25
_isInitializedbooleanfalsegenerated/neural_network/BernoulliRBM.ts:24
_pyPythonBridgeundefinedgenerated/neural_network/BernoulliRBM.ts:23
idstringundefinedgenerated/neural_network/BernoulliRBM.ts:20
optsanyundefinedgenerated/neural_network/BernoulliRBM.ts:21

Accessors

components_

Get Signature

get components_(): Promise<ArrayLike[]>

Weight matrix, where n_features is the number of visible units and n_components is the number of hidden units.

Returns Promise<ArrayLike[]>

Defined in generated/neural_network/BernoulliRBM.ts:511


feature_names_in_

Get Signature

get feature_names_in_(): Promise<ArrayLike>

Names of features seen during fit. Defined only when X has feature names that are all strings.

Returns Promise<ArrayLike>

Defined in generated/neural_network/BernoulliRBM.ts:586


h_samples_

Get Signature

get h_samples_(): Promise<ArrayLike[]>

Hidden Activation sampled from the model distribution, where batch_size is the number of examples per minibatch and n_components is the number of hidden units.

Returns Promise<ArrayLike[]>

Defined in generated/neural_network/BernoulliRBM.ts:536


intercept_hidden_

Get Signature

get intercept_hidden_(): Promise<ArrayLike>

Biases of the hidden units.

Returns Promise<ArrayLike>

Defined in generated/neural_network/BernoulliRBM.ts:461


intercept_visible_

Get Signature

get intercept_visible_(): Promise<ArrayLike>

Biases of the visible units.

Returns Promise<ArrayLike>

Defined in generated/neural_network/BernoulliRBM.ts:486


n_features_in_

Get Signature

get n_features_in_(): Promise<number>

Number of features seen during fit.

Returns Promise<number>

Defined in generated/neural_network/BernoulliRBM.ts:561


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/neural_network/BernoulliRBM.ts:72

Methods

dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Returns Promise<void>

Defined in generated/neural_network/BernoulliRBM.ts:124


fit()

fit(opts): Promise<any>

Fit the model to the data X.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeTraining data.
opts.y?ArrayLikeTarget values (undefined for unsupervised transformations).

Returns Promise<any>

Defined in generated/neural_network/BernoulliRBM.ts:141


fit_transform()

fit_transform(opts): Promise<any[]>

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters

ParameterTypeDescription
optsobject-
opts.fit_params?anyAdditional fit parameters.
opts.X?ArrayLike[]Input samples.
opts.y?ArrayLikeTarget values (undefined for unsupervised transformations).

Returns Promise<any[]>

Defined in generated/neural_network/BernoulliRBM.ts:180


get_feature_names_out()

get_feature_names_out(opts): Promise<any>

Get output feature names for transformation.

The feature names out will prefixed by the lowercased class name. For example, if the transformer outputs 3 features, then the feature names out are: \["class_name0", "class_name1", "class_name2"\].

Parameters

ParameterTypeDescription
optsobject-
opts.input_features?anyOnly used to validate feature names with the names seen in fit.

Returns Promise<any>

Defined in generated/neural_network/BernoulliRBM.ts:224


get_metadata_routing()

get_metadata_routing(opts): Promise<any>

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Parameters

ParameterTypeDescription
optsobject-
opts.routing?anyA MetadataRequest encapsulating routing information.

Returns Promise<any>

Defined in generated/neural_network/BernoulliRBM.ts:260


gibbs()

gibbs(opts): Promise<ArrayLike[]>

Perform one Gibbs sampling step.

Parameters

ParameterTypeDescription
optsobject-
opts.v?ArrayLike[]Values of the visible layer to start from.

Returns Promise<ArrayLike[]>

Defined in generated/neural_network/BernoulliRBM.ts:294


init()

init(py): Promise<void>

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/neural_network/BernoulliRBM.ts:85


partial_fit()

partial_fit(opts): Promise<any>

Fit the model to the partial segment of the data X.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLike[]Training data.
opts.y?ArrayLikeTarget values (undefined for unsupervised transformations).

Returns Promise<any>

Defined in generated/neural_network/BernoulliRBM.ts:326


score_samples()

score_samples(opts): Promise<ArrayLike>

Compute the pseudo-likelihood of X.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeValues of the visible layer. Must be all-boolean (not checked).

Returns Promise<ArrayLike>

Defined in generated/neural_network/BernoulliRBM.ts:363


set_output()

set_output(opts): Promise<any>

Set output container.

See Introducing the set_output API for an example on how to use the API.

Parameters

ParameterTypeDescription
optsobject-
opts.transform?"default" | "pandas" | "polars"Configure output of transform and fit_transform.

Returns Promise<any>

Defined in generated/neural_network/BernoulliRBM.ts:397


transform()

transform(opts): Promise<ArrayLike[]>

Compute the hidden layer activation probabilities, P(h=1|v=X).

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeThe data to be transformed.

Returns Promise<ArrayLike[]>

Defined in generated/neural_network/BernoulliRBM.ts:429