Skip to content

Conversation

oleksandr-pavlyk
Copy link
Contributor

@oleksandr-pavlyk oleksandr-pavlyk commented Sep 14, 2020

Closes #10

In [1]: import mkl_random

In [2]: rs = mkl_random.RandomState(1234, brng='NONDETERM')

In [3]: rs
Out[3]: <mkl_random.mklrand.RandomState at 0x2ba18d58faf0>

In [4]: rs.get_state()
Out[4]:
('NON_DETERMINISTIC',
 b'\x02RNG\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00\x00\x00\x00\n\x00\x00\x00')

In [6]: rs.seed(126) # brng has not been reset

In [7]: rs.get_state()
Out[7]:
('NON_DETERMINISTIC',
 b'\x02RNG\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00\x00\x00\x00\n\x00\x00\x00')

In [8]: rs.seed(1234, brng='MT2203')

In [9]: rs.get_state()
Out[9]:
('MT2203',
 b"\x02RNG\x14\x00\x00\x00(\x01\x00\x00\x00\x00\x00\x00\x00\x00\x90\x00\x00\x00\x00\x80i\xc0w\xa7\x0eF\xd8L\xfbi\rk\xd6[\t\x80F\xa0\xae\xa2as3\x9eQ\xd5f\x9b\x95>\xb9\x0f\xf5\xbe\xb0p\xe7o\xf
e\xe22\xc3\xad\x80D?\xe3X\x14\x86(D\xed(\xb1\xeb\xc6\xc5\xae\x00\xf8m,@\xd8\xd2\xd2\x98\x8b\xe74\x16\xd6\x07\xe3\xa9\x94q\xe5\xf1\xe1\xd8\x94\xf6\xf3\x8e8z\xddYrMym\xd9\x9a\xf1\x1e\xa8v\x97\
x1a\xcdvY\x82\xe9\x086!\xc8\x8db\xe5<\x1aH\xac&\x1c\xf8\x87\xc3\xefm\xc6\x17q\xb9\xda\xdcw\xcd.\xffI!3\xe8\x8e\xd5\x89\x19=\xca\x94\x88\xb2e|\xe5\xa0\xf0\xe3\xe5\xea\x0f\xd7K\xd4\xf4\xe2\x17
_\x1e\x89\x8f\xe7\x9dp\xa8}B\xa22l\x1c\xed\xedvtu6\xf3up\xc2W\xa8\xd9\xcf\xb59\r\xa6@\xce\xc7\x7f\xc2\x05[\xed\xd4y:h&\x8b\xe4\xc9\xcc\xa6\xf9\x07'\xa8g4\xd7\t\x07\xcf#\x94\xe8%\xa6\xa1\xcd\
xc1nd\xcc\x92\x80n\xe1i\x8a\xdc\x0b\x0e|\xc1[\xe2QWX\x98\xc6\x9f\x08\xe3\x1e\x00 W\xd6\xf7\x9c+\x11\xfa\xee\xbf\nH\xe6nmE\x00\x00\x00_\x05\x81\xaf\x80\xef~\xdd\x00\x80\xd7\xef\x08\x01\x0c\x0
2")

```
In [1]: import mkl_random

In [2]: rs = mkl_random.RandomState(1234, brng='NONDETERM')

In [3]: rs
Out[3]: <mkl_random.mklrand.RandomState at 0x2ba18d58faf0>

In [4]: rs.get_state()
Out[4]:
('NON_DETERMINISTIC',
 b'\x02RNG\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00\x00\x00\x00\n\x00\x00\x00')

In [6]: rs.seed(126) # brng has not been reset

In [7]: rs.get_state()
Out[7]:
('NON_DETERMINISTIC',
 b'\x02RNG\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00\x00\x00\x00\n\x00\x00\x00')

In [8]: rs.seed(1234, brng='MT2203')

In [9]: rs.get_state()
Out[9]:
('MT2203',
 b"\x02RNG\x14\x00\x00\x00(\x01\x00\x00\x00\x00\x00\x00\x00\x00\x90\x00\x00\x00\x00\x80i\xc0w\xa7\x0eF\xd8L\xfbi\rk\xd6[\t\x80F\xa0\xae\xa2as3\x9eQ\xd5f\x9b\x95>\xb9\x0f\xf5\xbe\xb0p\xe7o\xf
e\xe22\xc3\xad\x80D?\xe3X\x14\x86(D\xed(\xb1\xeb\xc6\xc5\xae\x00\xf8m,@\xd8\xd2\xd2\x98\x8b\xe74\x16\xd6\x07\xe3\xa9\x94q\xe5\xf1\xe1\xd8\x94\xf6\xf3\x8e8z\xddYrMym\xd9\x9a\xf1\x1e\xa8v\x97\
x1a\xcdvY\x82\xe9\x086!\xc8\x8db\xe5<\x1aH\xac&\x1c\xf8\x87\xc3\xefm\xc6\x17q\xb9\xda\xdcw\xcd.\xffI!3\xe8\x8e\xd5\x89\x19=\xca\x94\x88\xb2e|\xe5\xa0\xf0\xe3\xe5\xea\x0f\xd7K\xd4\xf4\xe2\x17
_\x1e\x89\x8f\xe7\x9dp\xa8}B\xa22l\x1c\xed\xedvtu6\xf3up\xc2W\xa8\xd9\xcf\xb59\r\xa6@\xce\xc7\x7f\xc2\x05[\xed\xd4y:h&\x8b\xe4\xc9\xcc\xa6\xf9\x07'\xa8g4\xd7\t\x07\xcf#\x94\xe8%\xa6\xa1\xcd\
xc1nd\xcc\x92\x80n\xe1i\x8a\xdc\x0b\x0e|\xc1[\xe2QWX\x98\xc6\x9f\x08\xe3\x1e\x00 W\xd6\xf7\x9c+\x11\xfa\xee\xbf\nH\xe6nmE\x00\x00\x00_\x05\x81\xaf\x80\xef~\xdd\x00\x80\xd7\xef\x08\x01\x0c\x0
2")
```
@oleksandr-pavlyk oleksandr-pavlyk merged commit 0ca76cc into master Sep 14, 2020
@oleksandr-pavlyk oleksandr-pavlyk deleted the suggestion-issue-10 branch September 5, 2023 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NONDETERM should never downgrade to MT19337

1 participant