def path(): """ Get path to Torch RNN. :return: Path to Torch RNN. """ try: return config.torch_rnn_path() except config.ConfigException as e: raise TorchRnnException(str(e))
def next_step(self): os.chdir(os.path.expanduser(config.torch_rnn_path())) print("next step:", str(self)) num_samples = min(1000, self._samples_remaining()) samples = torch_rnn.opencl_samples(self.seed, num_samples=num_samples) ids = [smith.checksum_str(sample) for sample in samples] db = sqlite3.connect(self.db_path) c = db.cursor() for id,sample in zip(ids, samples): c.execute('INSERT OR IGNORE INTO ContentFiles VALUES(?,?)', (id,sample)) db.commit() c.close() db.close()