MCPcopy Index your code
hub / github.com/DeepGraphLearning/FewShotRE / train

Method train

fewshot_re_kit/framework.py:100–293  ·  view source on GitHub ↗

model: a FewShotREModel instance model_name: Name of the model B: Batch size N: Num of classes for each batch K: Num of instances for each class in the support set Q: Num of instances for each class in the query set ckpt_dir: Directory of chec

(self,
              model,
              model_name,
              B, N_for_train, N_for_eval, K, Q,
              na_rate=0,
              learning_rate=1e-1,
              lr_step_size=20000,
              weight_decay=1e-5,
              train_iter=30000,
              val_iter=1000,
              val_step=2000,
              test_iter=3000,
              load_ckpt=None,
              save_ckpt=None,
              pytorch_optim=optim.SGD,
              bert_optim=False,
              warmup=True,
              warmup_step=300,
              grad_iter=1,
              fp16=False,
              pair=False,
              adv_dis_lr=1e-1,
              adv_enc_lr=1e-1)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

mainFunction · 0.95

Calls 5

__load_model__Method · 0.95
itemMethod · 0.95
evalMethod · 0.95
lossMethod · 0.80
accuracyMethod · 0.80

Tested by

no test coverage detected