Skip to content

Latest commit

 

History

History
464 lines (274 loc) · 12.5 KB

BernoulliRBM.md

File metadata and controls

464 lines (274 loc) · 12.5 KB

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

constructor()

Signature

new BernoulliRBM(opts?: object): BernoulliRBM;

Parameters

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

Returns

BernoulliRBM

Defined in: generated/neural_network/BernoulliRBM.ts:27

Methods

dispose()

Disposes of the underlying Python resources.

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

Signature

dispose(): Promise<void>;

Returns

Promise<void>

Defined in: generated/neural_network/BernoulliRBM.ts:131

fit()

Fit the model to the data X.

Signature

fit(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike Training data.
opts.y? ArrayLike Target values (undefined for unsupervised transformations).

Returns

Promise<any>

Defined in: generated/neural_network/BernoulliRBM.ts:148

fit_transform()

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit\_params and returns a transformed version of X.

Signature

fit_transform(opts: object): Promise<any[]>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike[] Input samples.
opts.fit_params? any Additional fit parameters.
opts.y? ArrayLike Target values (undefined for unsupervised transformations).

Returns

Promise<any[]>

Defined in: generated/neural_network/BernoulliRBM.ts:190

get_feature_names_out()

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"\].

Signature

get_feature_names_out(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.input_features? any Only used to validate feature names with the names seen in fit.

Returns

Promise<any>

Defined in: generated/neural_network/BernoulliRBM.ts:239

get_metadata_routing()

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Signature

get_metadata_routing(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.routing? any A MetadataRequest encapsulating routing information.

Returns

Promise<any>

Defined in: generated/neural_network/BernoulliRBM.ts:277

gibbs()

Perform one Gibbs sampling step.

Signature

gibbs(opts: object): Promise<ArrayLike[]>;

Parameters

Name Type Description
opts object -
opts.v? ArrayLike[] Values of the visible layer to start from.

Returns

Promise<ArrayLike[]>

Defined in: generated/neural_network/BernoulliRBM.ts:312

init()

Initializes the underlying Python resources.

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

Signature

init(py: PythonBridge): Promise<void>;

Parameters

Name Type
py PythonBridge

Returns

Promise<void>

Defined in: generated/neural_network/BernoulliRBM.ts:85

partial_fit()

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

Signature

partial_fit(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike[] Training data.
opts.y? ArrayLike Target values (undefined for unsupervised transformations).

Returns

Promise<any>

Defined in: generated/neural_network/BernoulliRBM.ts:345

score_samples()

Compute the pseudo-likelihood of X.

Signature

score_samples(opts: object): Promise<ArrayLike>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike Values of the visible layer. Must be all-boolean (not checked).

Returns

Promise<ArrayLike>

Defined in: generated/neural_network/BernoulliRBM.ts:385

set_output()

Set output container.

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

Signature

set_output(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.transform? "default" | "pandas" Configure output of transform and fit\_transform.

Returns

Promise<any>

Defined in: generated/neural_network/BernoulliRBM.ts:420

transform()

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

Signature

transform(opts: object): Promise<ArrayLike[]>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike The data to be transformed.

Returns

Promise<ArrayLike[]>

Defined in: generated/neural_network/BernoulliRBM.ts:453

Properties

_isDisposed

boolean = false

Defined in: generated/neural_network/BernoulliRBM.ts:25

_isInitialized

boolean = false

Defined in: generated/neural_network/BernoulliRBM.ts:24

_py

PythonBridge

Defined in: generated/neural_network/BernoulliRBM.ts:23

id

string

Defined in: generated/neural_network/BernoulliRBM.ts:20

opts

any

Defined in: generated/neural_network/BernoulliRBM.ts:21

Accessors

components_

Weight matrix, where n\_features is the number of visible units and n\_components is the number of hidden units.

Signature

components_(): Promise<ArrayLike[]>;

Returns

Promise<ArrayLike[]>

Defined in: generated/neural_network/BernoulliRBM.ts:536

feature_names_in_

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

Signature

feature_names_in_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/neural_network/BernoulliRBM.ts:611

h_samples_

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.

Signature

h_samples_(): Promise<ArrayLike[]>;

Returns

Promise<ArrayLike[]>

Defined in: generated/neural_network/BernoulliRBM.ts:561

intercept_hidden_

Biases of the hidden units.

Signature

intercept_hidden_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/neural_network/BernoulliRBM.ts:486

intercept_visible_

Biases of the visible units.

Signature

intercept_visible_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/neural_network/BernoulliRBM.ts:511

n_features_in_

Number of features seen during fit.

Signature

n_features_in_(): Promise<number>;

Returns

Promise<number>

Defined in: generated/neural_network/BernoulliRBM.ts:586

py

Signature

py(): PythonBridge;

Returns

PythonBridge

Defined in: generated/neural_network/BernoulliRBM.ts:72

Signature

py(pythonBridge: PythonBridge): void;

Parameters

Name Type
pythonBridge PythonBridge

Returns

void

Defined in: generated/neural_network/BernoulliRBM.ts:76