yobx.sklearn.neural_network.bernoulli_rbm#

yobx.sklearn.neural_network.bernoulli_rbm.sklearn_bernoulli_rbm(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: BernoulliRBM, X: str, name: str = 'bernoulli_rbm') str[source]#

Converts a sklearn.neural_network.BernoulliRBM into ONNX.

The transform computes the probability that each hidden unit is activated given the visible input:

P(h=1|v) = sigmoid(v @ W.T + h_bias)

where W is components_ of shape (n_components, n_features) and h_bias is intercept_hidden_ of shape (n_components,).

Graph structure:

X  ──MatMul(components_.T)──Add(intercept_hidden_)──Sigmoid──►  hidden
Parameters:
  • g – the graph builder to add nodes to

  • sts – shapes defined by scikit-learn

  • outputs – desired output names (hidden probabilities)

  • estimator – a fitted BernoulliRBM

  • X – input tensor name

  • name – prefix for added node names

Returns:

output tensor name for the hidden unit probabilities