[Numpy-discussion] Re: Original seed of a BitGenerator

2024-08-02 Thread Robert Kern
On Fri, Aug 2, 2024 at 1:28 AM Andrew Nelson  wrote:

> When using the new `Generator`s for stochastic optimisation I sometimes
> find myself possessing a great solution, but am wondering what path the
> random number generation took to get to that point.
>
> I know that I can get the current state of the BitGenerators. However,
> what I'd like to do is query the BitGenerator to figure out how the
> BitGenerator was setup in the first place.
>
> i.e. either:
>
> - the seed/SeedSequence that was used to construct the BitGenerator
>

>>> rng = np.random.default_rng()
>>> rng.bit_generator.seed_seq
SeedSequence(
entropy=186013007116029215180532390504704448637,
)

In some older versions of numpy, the attribute was semi-private as
_seed_seq, if you're still using one of those.

--
Robert Kern
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: Original seed of a BitGenerator

2024-08-02 Thread Neal Becker
On Fri, Aug 2, 2024 at 9:37 AM Robert Kern  wrote:

> On Fri, Aug 2, 2024 at 1:28 AM Andrew Nelson  wrote:
>
>> When using the new `Generator`s for stochastic optimisation I sometimes
>> find myself possessing a great solution, but am wondering what path the
>> random number generation took to get to that point.
>>
>> I know that I can get the current state of the BitGenerators. However,
>> what I'd like to do is query the BitGenerator to figure out how the
>> BitGenerator was setup in the first place.
>>
>> i.e. either:
>>
>> - the seed/SeedSequence that was used to construct the BitGenerator
>>
>
> >>> rng = np.random.default_rng()
> >>> rng.bit_generator.seed_seq
> SeedSequence(
> entropy=186013007116029215180532390504704448637,
> )
>
> In some older versions of numpy, the attribute was semi-private as
> _seed_seq, if you're still using one of those.
>
> In many cases you can add your own attributes to python objects, so you
can record the seed yourself as
rng.my_seed = blah

I didn't test if the BitGenerator supports this

-- 
*Those who don't understand recursion are doomed to repeat it*
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] next NumPy Optimization Team meeting - August 5th, 2024 at 5 pm UTC

2024-08-02 Thread Inessa Pawson
The next NumPy Optimization Team meeting will be held this Monday, August
5th at 5 pm UTC.
Join us via Zoom:
https://numfocus-org.zoom.us/j/81261288210?pwd=iwV99tGSjR61RTGEERKM4QKxe46g1n.1
.
Everyone is welcome and encouraged to attend.
To add to the meeting agenda the topics you’d like to discuss, follow the
link: https://hackmd.io/dVdSlQ0TThWkOk0OkmGsmw?both.
For the notes from the previous meetings, visit:
https://github.com/numpy/archive/tree/main/optim_team_meetings.

-- 
Cheers,
Inessa

Inessa Pawson
GitHub: inessapawson
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] NumPy 2.0 AMA with Nathan Goldbaum

2024-08-02 Thread Inessa Pawson
If you missed the NumPy 2.0 birds-of-a-feather session at SciPy 2024, here
is your lucky second chance!

Join an AMA with Nathan Goldbaum, a NumPy maintainer from Quansight Labs,
hosted by OpenTeams to discuss the team’s work on NumPy 2.0 and future
direction of the project. This is also an opportunity for you to share any
challenges you ran into with your project while transitioning to NumPy 2.0
and seek advice if you are still working on it.

WHEN:: Tuesday, August 6th at 12 pm ET / 4 pm UTC
WHERE:: Join us via Zoom:
https://numfocus-org.zoom.us/webinar/register/WN_HRKnCdfhStW31Hc-LEnwfQ
Registration is required.

-- 
Cheers,
Inessa

Inessa Pawson
GitHub: inessapawson
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: Original seed of a BitGenerator

2024-08-02 Thread Andrew Nelson
>
>
>>
>> - the seed/SeedSequence that was used to construct the BitGenerator
>>
>
> >>> rng = np.random.default_rng()
> >>> rng.bit_generator.seed_seq
> SeedSequence(
> entropy=186013007116029215180532390504704448637,
> )
>
> In some older versions of numpy, the attribute was semi-private as
> _seed_seq, if you're still using one of those.
>
>

This is exactly what I was looking for.

>
>
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com