# Streamed batch training with manual update - scaling considerations

**URL:** <https://discourse.edwardlib.org/t/streamed-batch-training-with-manual-update-scaling-considerations/262>\
**Category:** General\
**Created:** [July 26, 2017, 11:24am UTC](https://discourse.edwardlib.org/t/streamed-batch-training-with-manual-update-scaling-considerations/262 "2017-07-26T11:24:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dustin](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.edwardlib.org/dustin/32/134_2.png) [@dustin](https://discourse.edwardlib.org/u/dustin)\
**Post date:** [August 11, 2017, 4:03pm UTC](https://discourse.edwardlib.org/t/streamed-batch-training-with-manual-update-scaling-considerations/262/2 "2017-08-11T16:03:33Z")

</div>

> [@MushroomHunting](#):
>
> Is the scale parameter only relevant if one uses inference.run at first with N \> M training data points.

To some degree, yes. It’s used generally to scale any computation with respect to the random variables. For example, you might use it for masking.

> [@MushroomHunting](#):
>
> Is n\_samples only relevant if one uses an inference. run. call? I.e. if from the beginning if you have a large amount of data to train first on, and then the model is exposed to completely new data in a streaming situation. If not where does this fit in

`n_samples` is an algorithm hyperparameter in `ed.KLqp`, representing the number of samples to estimate the gradient of the loss function. It is always relevant whenever running the algorithm.

> [@MushroomHunting](#):
>
> In the case of having no data initially, and then acquiring data accumulating into buffers of size M, is it enough to simply have N=M giving a scale of 1 ?

That would only work if after each streaming batch, you re-set the prior distribution to be the inferred posterior from the batch. Otherwise, imagine you had a billion streaming points, with a batch size of 1; without scaling the likelihood by 1 million, the prior overwhelms the likelihood so the posterior will not differ much from the prior.

The discussion in [Iterative estimators ("bayes filters") in Edward? - #2 by dustin](https://discourse.edwardlib.org/t/iterative-estimators-bayes-filters-in-edward/104/2) provides most detail.

---

_[View the full topic](https://discourse.edwardlib.org/t/streamed-batch-training-with-manual-update-scaling-considerations/262)._
