test_cases.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -e
  16. set -x
  17. for test_name in more_pos less_pos less_user less_item more_user more_item other_names;
  18. do
  19. CACHED_DATADIR='/data/cache/ml-20m'
  20. NEW_DIR=${CACHED_DATADIR}/${test_name}
  21. echo "Trying to run on modified dataset: $test_name"
  22. python -m torch.distributed.launch --nproc_per_node=1 --use_env ncf.py --data ${NEW_DIR} --epochs 1
  23. echo "Model runs on modified dataset: $test_name"
  24. done
  25. for test_sample in '0' '10' '200';
  26. do
  27. CACHED_DATADIR='/data/cache/ml-20m'
  28. NEW_DIR=${CACHED_DATADIR}/sample_${test_name}
  29. echo "Trying to run on dataset with test sampling: $test_sample"
  30. python -m torch.distributed.launch --nproc_per_node=1 --use_env ncf.py --data ${NEW_DIR} --epochs 1
  31. echo "Model runs on dataset with test sampling: $test_sample"
  32. done
  33. for online_sample in '0' '1' '10';
  34. do
  35. CACHED_DATADIR='/data/cache/ml-20m'
  36. echo "Trying to run with train sampling: $online_sample"
  37. python -m torch.distributed.launch --nproc_per_node=1 --use_env ncf.py --data ${CACHED_DATADIR} --epochs 1 -n ${online_sample}
  38. echo "Model runs with train sampling: $online_sample"
  39. done