Mercurial > repos > laurenmarazzi > netisce_test
diff tools/myTools/bin/sfa/analysis/random/weight.py @ 1:7e5c71b2e71f draft default tip
Uploaded
author | laurenmarazzi |
---|---|
date | Wed, 22 Dec 2021 16:00:34 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/myTools/bin/sfa/analysis/random/weight.py Wed Dec 22 16:00:34 2021 +0000 @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +import sfa +from .base import BaseRandomBatchSimulator + + +class RandomWeightBatchSimulator(BaseRandomBatchSimulator): + def __init__(self, *args, bounds=(-3,0), **kwargs): + super().__init__(*args, **kwargs) + self._lb = bounds[0] + self._ub = bounds[1] + + def _randomize(self): + sfa.rand_weights(self._W, self._lb, self._ub, inplace=True) +# end of class +