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.
new BernoulliRBM(opts?: object): BernoulliRBM;
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 |
Defined in: generated/neural_network/BernoulliRBM.ts:27
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
dispose(): Promise<void>;
Promise
<void
>
Defined in: generated/neural_network/BernoulliRBM.ts:131
Fit the model to the data X.
fit(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike |
Training data. |
opts.y? |
ArrayLike |
Target values (undefined for unsupervised transformations). |
Promise
<any
>
Defined in: generated/neural_network/BernoulliRBM.ts:148
Fit to data, then transform it.
Fits transformer to X
and y
with optional parameters fit\_params
and returns a transformed version of X
.
fit_transform(opts: object): Promise<any[]>;
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). |
Promise
<any
[]>
Defined in: generated/neural_network/BernoulliRBM.ts:190
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"\]
.
get_feature_names_out(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.input_features? |
any |
Only used to validate feature names with the names seen in fit . |
Promise
<any
>
Defined in: generated/neural_network/BernoulliRBM.ts:239
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
get_metadata_routing(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.routing? |
any |
A MetadataRequest encapsulating routing information. |
Promise
<any
>
Defined in: generated/neural_network/BernoulliRBM.ts:277
Perform one Gibbs sampling step.
gibbs(opts: object): Promise<ArrayLike[]>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.v? |
ArrayLike [] |
Values of the visible layer to start from. |
Promise
<ArrayLike
[]>
Defined in: generated/neural_network/BernoulliRBM.ts:312
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
init(py: PythonBridge): Promise<void>;
Name | Type |
---|---|
py |
PythonBridge |
Promise
<void
>
Defined in: generated/neural_network/BernoulliRBM.ts:85
Fit the model to the partial segment of the data X.
partial_fit(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike [] |
Training data. |
opts.y? |
ArrayLike |
Target values (undefined for unsupervised transformations). |
Promise
<any
>
Defined in: generated/neural_network/BernoulliRBM.ts:345
Compute the pseudo-likelihood of X.
score_samples(opts: object): Promise<ArrayLike>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike |
Values of the visible layer. Must be all-boolean (not checked). |
Promise
<ArrayLike
>
Defined in: generated/neural_network/BernoulliRBM.ts:385
Set output container.
See Introducing the set_output API for an example on how to use the API.
set_output(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.transform? |
"default" | "pandas" |
Configure output of transform and fit\_transform . |
Promise
<any
>
Defined in: generated/neural_network/BernoulliRBM.ts:420
Compute the hidden layer activation probabilities, P(h=1|v=X).
transform(opts: object): Promise<ArrayLike[]>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike |
The data to be transformed. |
Promise
<ArrayLike
[]>
Defined in: generated/neural_network/BernoulliRBM.ts:453
boolean
=false
Defined in: generated/neural_network/BernoulliRBM.ts:25
boolean
=false
Defined in: generated/neural_network/BernoulliRBM.ts:24
PythonBridge
Defined in: generated/neural_network/BernoulliRBM.ts:23
string
Defined in: generated/neural_network/BernoulliRBM.ts:20
any
Defined in: generated/neural_network/BernoulliRBM.ts:21
Weight matrix, where n\_features
is the number of visible units and n\_components
is the number of hidden units.
components_(): Promise<ArrayLike[]>;
Promise
<ArrayLike
[]>
Defined in: generated/neural_network/BernoulliRBM.ts:536
Names of features seen during fit. Defined only when X
has feature names that are all strings.
feature_names_in_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/neural_network/BernoulliRBM.ts:611
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.
h_samples_(): Promise<ArrayLike[]>;
Promise
<ArrayLike
[]>
Defined in: generated/neural_network/BernoulliRBM.ts:561
intercept_hidden_
Biases of the hidden units.
intercept_hidden_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/neural_network/BernoulliRBM.ts:486
Biases of the visible units.
intercept_visible_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/neural_network/BernoulliRBM.ts:511
Number of features seen during fit.
n_features_in_(): Promise<number>;
Promise
<number
>
Defined in: generated/neural_network/BernoulliRBM.ts:586
py(): PythonBridge;
PythonBridge
Defined in: generated/neural_network/BernoulliRBM.ts:72
py(pythonBridge: PythonBridge): void;
Name | Type |
---|---|
pythonBridge |
PythonBridge |
void
Defined in: generated/neural_network/BernoulliRBM.ts:76