Exemplo n.º 1
0
    def __init__(self, hparams):
        self._session = None
        self.hparams = hparams

        # Set the random seed to be sure the same validation set
        # is used for each model
        np.random.seed(0)
        self.dataset = data_utils.DataSet(hparams)
        np.random.seed()  # Put the random seed back to random
        # extra stuff for ray
        self._build_models()
        self._new_session()
        self._session.__enter__()
Exemplo n.º 2
0
    def __init__(self, hparams):
        self._session = None
        self.hparams = hparams

        # Set the random seed to be sure the same validation set
        # is used for each model
        np.random.seed(0)
        self.data_loader = data_utils.DataSet(hparams)
        np.random.seed()  # Put the random seed back to random
        self.data_loader.reset()

        # extra stuff for ray
        self._build_models()
        self._new_session()
        self._setup_model(hparams)
        self._setup_teacher()
        if hparams.pretrained_model:
            tf.logging.info('load pretrained model')
            self.extract_model_spec(hparams.pretrained_model)
        self._session.__enter__()