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

Hard-coded OPU simulated device seed #4

@lucgiffon

Description

@lucgiffon

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions