svo.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env bash
  2. #
  3. # copyright (c) 2017-present, facebook, inc.
  4. # all rights reserved.
  5. #
  6. # this source code is licensed under the MIT license found in the
  7. # license file in the root directory of this source tree.
  8. #
  9. # script for SVO
  10. DIR=data/SVO-tensor-dataset
  11. FASTTEXTDIR=../../
  12. # compile
  13. pushd $FASTTEXTDIR
  14. make opt
  15. popd
  16. ft=${FASTTEXTDIR}/fasttext
  17. ## Train model and test it on validation:
  18. dim=200
  19. epoch=3
  20. model=svo
  21. echo "---- train ----"
  22. time $ft supervised -input ${DIR}/ft_svo_data_train_1000000.dat \
  23. -dim $dim -epoch $epoch -output ${model} -lr .2 -thread 20
  24. echo "computing raw hit@5%..."
  25. $ft test ${model}.bin ${DIR}/ft_svo_data_test_250000.dat 227 2> /dev/null | awk '{if(NR==3) print "raw hit@5%="$2}'
  26. echo "---- train + valid ----"
  27. time $ft supervised -input ${DIR}/ft_svo_data-valid+train.dat \
  28. -dim $dim -epoch $epoch -output ${model} -lr .2 -thread 20
  29. echo "computing raw hit@5%..."
  30. $ft test ${model}.bin ${DIR}/ft_svo_data_test_250000.dat 227 2> /dev/null | awk '{if(NR==3) print "raw hit@5%="$2}'