Skip to content
This repository was archived by the owner on Sep 12, 2023. It is now read-only.

Hard-coded OPU simulated device seed #4

Open
lucgiffon opened this issue Sep 7, 2021 · 1 comment
Open

Hard-coded OPU simulated device seed #4

lucgiffon opened this issue Sep 7, 2021 · 1 comment
Assignees

Comments

@lucgiffon
Copy link

lucgiffon commented Sep 7, 2021

Hello,

In lightonml 1.4, the SimulatedOpuDevice inner _random_matrix generation has a hard coded seed. See the prototype of the method build_random_matrix of the SimulatedOpuDevice class:

def build_random_matrix(self, n_features, n_components, seed=0):

In the method body, the seed is used in a np.random.RandomState object. It is not possible (I think) for the user to set this function argument and then each instance of SimulatedOpuDevice use the exact same implicit random matrix. I don't think this is a desirable behavior. I don't think it is desired either because I see there is a _seed attribute in the SimulatedOpuDevice class that is set to None but not used for random generation.

I think it would be better to have different OPUSimulatedDevice instances at each run, and/or to have write access to the seed for the implicit random matrix generation. An easy way to achieve this would be to make the _seed attribute of SimulatedOpuDevice settable and then to use it in build_random_matrix.

Thank you for your read!
Bye
Luc

@CharlesB2 CharlesB2 self-assigned this Sep 8, 2021
@CharlesB2
Copy link
Contributor

Hi Luc, yes adding this possibility will be useful indeed, thanks for the suggestion! Will post an update early next week.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants