加载中 README.rst +2 −1 原始行号 差异行号 差异行 加载中 @@ -158,5 +158,6 @@ by using `model.vae` directly, for example: # `x` is a :class:`tfsnippet.stochastic.StochasticTensor`, from which # you may derive many useful outputs, for example: x.tensor # the `x` samples x.log_prob(group_ndims=0) # element-wise log p(x|z) x.log_prob(group_ndims=0) # element-wise log p(x|z) of sampled x x.distribution.log_prob(input_x) # the reconstruction probability x.distribution.mean, x.distribution.std # mean and std of p(x|z) donut/augmentation.py +2 −2 原始行号 差异行号 差异行 import numpy as np from tfsnippet.utils import docstring_inherit from tfsnippet.utils import DocInherit __all__ = ['DataAugmentation', 'MissingDataInjection'] @DocInherit class DataAugmentation(object): """ Base class for data augmentation in training. 加载中 加载中 @@ -85,7 +86,6 @@ class MissingDataInjection(DataAugmentation): """Get the ratio of missing points to inject.""" return self._missing_rate @docstring_inherit(DataAugmentation.augment) def _augment(self, values, labels, missing): inject_y = np.random.binomial(1, self.missing_rate, size=values.shape) inject_idx = np.where(inject_y.astype(np.bool))[0] 加载中 加载中
README.rst +2 −1 原始行号 差异行号 差异行 加载中 @@ -158,5 +158,6 @@ by using `model.vae` directly, for example: # `x` is a :class:`tfsnippet.stochastic.StochasticTensor`, from which # you may derive many useful outputs, for example: x.tensor # the `x` samples x.log_prob(group_ndims=0) # element-wise log p(x|z) x.log_prob(group_ndims=0) # element-wise log p(x|z) of sampled x x.distribution.log_prob(input_x) # the reconstruction probability x.distribution.mean, x.distribution.std # mean and std of p(x|z)
donut/augmentation.py +2 −2 原始行号 差异行号 差异行 import numpy as np from tfsnippet.utils import docstring_inherit from tfsnippet.utils import DocInherit __all__ = ['DataAugmentation', 'MissingDataInjection'] @DocInherit class DataAugmentation(object): """ Base class for data augmentation in training. 加载中 加载中 @@ -85,7 +86,6 @@ class MissingDataInjection(DataAugmentation): """Get the ratio of missing points to inject.""" return self._missing_rate @docstring_inherit(DataAugmentation.augment) def _augment(self, values, labels, missing): inject_y = np.random.binomial(1, self.missing_rate, size=values.shape) inject_idx = np.where(inject_y.astype(np.bool))[0] 加载中