n = len(data)
new_sample_size = n + self.sample_size
// update the first moment
x = be.expit(self.int_params["loc"])
x *= self.sample_size / new_sample_size
x += n * be.mean(data, axis=0) / new_sample_size
// update the location parameter
self.int_params["loc"] = be.logit(x)
// update the sample size
self.sample_size = new_sample_size
After Change
// get the current value of the first moment
x = be.expit(self.int_params["loc"])
// update the sample size
n = len(data)
new_sample_size = n + self.sample_size
// update the first moment
x *= self.sample_size / new_sample_size
x += n * be.mean(data, axis=0) / new_sample_size
// update the class attributes
self.int_params = BernoulliLayer.IntrinsicParams(be.logit(x))
self.sample_size = new_sample_size
def shrink_parameters(self, shrinkage=1):