VariationalTrainingObjectives

class tfsnippet.VariationalTrainingObjectives(vi)

Bases: object

Factory for variational training objectives.

Methods Summary

iwae([name]) Get the SGVB training objective for importance weighted objective.
nvil([baseline, center_by_moving_average, …]) Get the NVIL training objective.
reinforce([baseline, …]) Get the NVIL training objective.
sgvb([name]) Get the SGVB training objective.
vimco([name]) Get the VIMCO training objective.

Methods Documentation

iwae(name=None)

Get the SGVB training objective for importance weighted objective.

Returns:
The per-data SGVB training objective for importance
weighted objective.
Return type:tf.Tensor

See also

tfsnippet.variational.iwae_estimator()

Parameters:name (str) – Default name of the name scope. If not specified, generate one according to the method name.
nvil(baseline=None, center_by_moving_average=True, decay=0.8, baseline_cost_weight=1.0, name=None)

Get the NVIL training objective.

Parameters:
  • baseline – Values of the baseline function math:C_{psi}(mathbf{x}) given input x. If this is not specified, then this method will degenerate to the REINFORCE algorithm, with only a moving average estimated constant baseline c.
  • center_by_moving_average (bool) – Whether or not to use the moving average to maintain an estimation of c in above equations?
  • decay – The decaying factor for moving average.
  • baseline_cost_weight – Weight of the baseline cost.
  • name (str) – Default name of the name scope. If not specified, generate one according to the method name.
Returns:

The per-data NVIL training objective.

Return type:

tf.Tensor

reinforce(baseline=None, center_by_moving_average=True, decay=0.8, baseline_cost_weight=1.0, name=None)

Get the NVIL training objective.

Parameters:
  • baseline – Values of the baseline function math:C_{psi}(mathbf{x}) given input x. If this is not specified, then this method will degenerate to the REINFORCE algorithm, with only a moving average estimated constant baseline c.
  • center_by_moving_average (bool) – Whether or not to use the moving average to maintain an estimation of c in above equations?
  • decay – The decaying factor for moving average.
  • baseline_cost_weight – Weight of the baseline cost.
  • name (str) – Default name of the name scope. If not specified, generate one according to the method name.
Returns:

The per-data NVIL training objective.

Return type:

tf.Tensor

sgvb(name=None)

Get the SGVB training objective.

Returns:
The per-data SGVB training objective.
It is the negative of ELBO, which should directly be minimized.
Return type:tf.Tensor

See also

tfsnippet.variational.sgvb_estimator()

Parameters:name (str) – Default name of the name scope. If not specified, generate one according to the method name.
vimco(name=None)

Get the VIMCO training objective.

Returns:The per-data VIMCO training objective.
Return type:tf.Tensor

See also

tfsnippet.variational.vimco_estimator()

Parameters:name (str) – Default name of the name scope. If not specified, generate one according to the method name.