def __init__(self, seed=DEFAULT_SEED):
        """
        Initialize seed and global random variables.
        """
        if seed != self.DEFAULT_SEED:
            self._seed = seed
        elif 'DEEPY_SEED' in os.environ:
            self._seed = int(os.environ['DEEPY_SEED'])
        else:
            self._seed = self.DEFAULT_SEED
        if self._seed != self.DEFAULT_SEED:
            logging.info("set global random seed to %d" % self._seed)

        self._numpy_rand = np.random.RandomState(seed=self._seed)
        self._theano_rand = RandomStreams(seed=self._seed)
        self._shared_rand = SharedRandomStreams(seed=self._seed)
        self._default_initializer = None
def __init__ ( self , seed = DEFAULT_SEED ) : if seed != self . DEFAULT_SEED : self . _seed = seed elif 'DEEPY_SEED' in os . environ : self . _seed = int ( os . environ [ 'DEEPY_SEED' ] ) else : self . _seed = self . DEFAULT_SEED if self . _seed != self . DEFAULT_SEED : logging . info ( "set global random seed to %d" % self . _seed ) self . _numpy_rand = np . random . RandomState ( seed = self . _seed ) self . _theano_rand = RandomStreams ( seed = self . _seed ) self . _shared_rand = SharedRandomStreams ( seed = self . _seed ) self . _default_initializer = None
Initialize seed and global random variables.