You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_trainer.py 387 B

12345678910111213
  1. def test_trainer():
  2. Config = namedtuple("config", ["epochs", "validate", "save_when_better"])
  3. train_config = Config(epochs=5, validate=True, save_when_better=True)
  4. trainer = Trainer(train_config)
  5. net = ToyModel()
  6. data = np.random.rand(20, 6)
  7. dev_data = np.random.rand(20, 6)
  8. trainer.train(net, data, dev_data)
  9. if __name__ == "__main__":
  10. test_trainer()

一款轻量级的自然语言处理(NLP)工具包,目标是减少用户项目中的工程型代码,例如数据处理循环、训练循环、多卡运行等