Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRandom::set_seed in python interface doesn't work #4223

Closed
FaroukY opened this issue Apr 2, 2018 · 1 comment
Closed

CRandom::set_seed in python interface doesn't work #4223

FaroukY opened this issue Apr 2, 2018 · 1 comment

Comments

@FaroukY
Copy link
Contributor

FaroukY commented Apr 2, 2018

In python, the following code fails:

>>> from shogun import *
>>> rng = get_global_rand()
>>> rng.set_seed(17)

The error is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'SwigPyObject' object has no attribute 'set_seed'

I am not sure how to set the seed in the python interface would be. And the example in my Cookbook needs to fix the random seed before it runs. Any ideas?

@karlnapf
Copy link
Member

karlnapf commented Apr 2, 2018

import shogun as sg
sg.Math.init_random(1)

This will change but for now works

@karlnapf karlnapf closed this as completed Apr 2, 2018
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

No branches or pull requests

2 participants