sgvb_estimator

tfsnippet.sgvb_estimator(values, axis=None, keepdims=False, name=None)

Derive the gradient estimator for \(\mathbb{E}_{q(\mathbf{z}|\mathbf{x})}\big[f(\mathbf{x},\mathbf{z})\big]\), by SGVB (Kingma, D.P. and Welling, M., 2013) algorithm.

\[\nabla \, \mathbb{E}_{q(\mathbf{z}|\mathbf{x})}\big[f(\mathbf{x},\mathbf{z})\big] = \nabla \, \mathbb{E}_{q(\mathbf{\epsilon})}\big[f(\mathbf{x},\mathbf{z}(\mathbf{\epsilon}))\big] = \mathbb{E}_{q(\mathbf{\epsilon})}\big[\nabla f(\mathbf{x},\mathbf{z}(\mathbf{\epsilon}))\big]\]
Parameters:
  • values – Values of the target function given z and x, i.e., \(f(\mathbf{z},\mathbf{x})\).
  • axis – The sampling axes to be reduced in outputs. If not specified, no axis will be reduced.
  • keepdims (bool) – When axis is specified, whether or not to keep the reduced axes? (default False)
  • name (str) – Default name of the name scope. If not specified, generate one according to the method name.
Returns:

The surrogate for optimizing the original target.

Maximizing/minimizing this surrogate via gradient descent will effectively maximize/minimize the original target.

Return type:

tf.Tensor