The ComplexQNN is a quantum-inspired complex-valued neural network for NLP tasks.
Dependencies
- pytorch>=1.12
- allennlp==2.10
- complexPyTorch=0.4
allennlp train config/complexqnn.jsonnet --include-package work -s ./result/mytrain2 -f --dry-run
- --dry-run # load dataset but do not train the model
- -f # force training, this command will override the save path
- -s # save path
- --include-package $path # personal work path including model, classifier and so on
- config/xxx.jsonnet # config file with jsonnet format
allennlp train config/cnn.jsonnet --include-package work -s ./result/cr_cnn -f --dry-run
allennlp train config/gru.jsonnet --include-package work -s ./result/mpqa_gru -f --dry-run
allennlp train config/elmo.jsonnet --include-package work -s ./result/sst2_emlo -f
allennlp train config/bert.jsonnet --include-package work -s ./result/subj_bert -f
allennlp train config/complexcnn.jsonnet --include-package work -s ./result/cr_complexcnn -f
allennlp train config/complexqdnn.jsonnet --include-package work -s ./result/subj_complexqnn -f
Please modify the variable "task_name" in model.jsonnet to change different datasets.
# delete training models
rm ./result/*/*_state_*.th -f