this update substitutes the sequential batch simulation in batch_toad with array operations and adds support for batches that have batch_size different parameter values. batch_toad and toad are also combined into toad, and summary calculation is broken into four nodes that represent summaries calculated at each lag = 1, 2, 4, 8. the update on summary calculation is cosmetic and was done with the lotka-volterra and arch examples in mind, ie to match how summaries are represented in those ones.
Examples:
the old and new toad(1.5, 35, 0.5) should take around the same time while the new toad(1.5, 35, 0.5, batch_size=100) should run much faster than the old toad_batch(1.5, 35, 0.5, batch_size=100). the difference was around 5 seconds vs 250 ms on my laptop, measured with timeit in notebook environment.
when x = toad([1.5, 1.5], [2., 75.], [0.5, 0], n_toads=2, n_days=7, batch_size=2), the observation sets x[:, :, 0] and x[:, :, 1] should have different characteristics. the moved distances should be shorter in the first set and there should be no returns in the second set. the old version does not support batches with different parameters so toad_batch([1.5, 1.5], [2., 75.], [0.5, 0], n_toads=2, n_days=7, batch_size=2) returns two observation sets with the same characteristics.
Please make sure
[x] You have updated the CHANGELOG.rst
[x] You have provided a short summary of your changes (see previous section)
[x] You have listed the copyright holder for the work you are submitting (see next section)
If your contribution adds, removes or somehow changes the functional behavior of the package, please check that
[ ] You have included or updated all the relevant documentation
[ ] You have added appropriate unit tests to ensure the new features behave as expected
and the proposed changes pass all unit tests (check step 6 of CONTRIBUTING.rst for details)
Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:
Summary:
this update substitutes the sequential batch simulation in
batch_toad
with array operations and adds support for batches that havebatch_size
different parameter values.batch_toad
andtoad
are also combined intotoad
, and summary calculation is broken into four nodes that represent summaries calculated at eachlag = 1, 2, 4, 8
. the update on summary calculation is cosmetic and was done with the lotka-volterra and arch examples in mind, ie to match how summaries are represented in those ones.Examples:
the old and new
toad(1.5, 35, 0.5)
should take around the same time while the newtoad(1.5, 35, 0.5, batch_size=100)
should run much faster than the oldtoad_batch(1.5, 35, 0.5, batch_size=100)
. the difference was around 5 seconds vs 250 ms on my laptop, measured with timeit in notebook environment.when
x = toad([1.5, 1.5], [2., 75.], [0.5, 0], n_toads=2, n_days=7, batch_size=2)
, the observation setsx[:, :, 0]
andx[:, :, 1]
should have different characteristics. the moved distances should be shorter in the first set and there should be no returns in the second set. the old version does not support batches with different parameters sotoad_batch([1.5, 1.5], [2., 75.], [0.5, 0], n_toads=2, n_days=7, batch_size=2)
returns two observation sets with the same characteristics.Please make sure
If your contribution adds, removes or somehow changes the functional behavior of the package, please check that
and the proposed changes pass all unit tests (check step 6 of CONTRIBUTING.rst for details)
Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: