all-the-plots.sh 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. function maybe_make_diffmap () {
  2. local stem="$1"
  3. local name="$2"
  4. local epsilon="$3"
  5. local points="$4"
  6. local k="$5"
  7. local normalize="$6"
  8. local start_time="$7"
  9. # Not sure how CPUWeight and CPUQuota work, given that this reaches
  10. # 100% usage on my system, but at least the system doesn't hang anymore.
  11. local to="$name(k=$k,eps=$epsilon,points=$points,$normalize,start-time=${start_time}).diffmap"
  12. if [ ! -f "$to" ]
  13. then
  14. echo "computing: $to"
  15. # TODO: How does CPUQuota work? 1%, 400%, ???
  16. # TODO: make this non-systemd-specific, avoid sudo
  17. if sudo -E env PATH=$PATH systemd-run --scope -p MemoryAccounting=yes -p CPUAccounting=true -p MemorySwapMax=20M -p MemoryMax=6G -p CPUWeight=10 --uid=$USER --gid=$USER timeout 40s python3 construct-diffusion-map.py "$stem" "$to.tmp" "--points=$points" -k "$k" "--eps=$epsilon" "$normalize" --start-time "${start_time}";
  18. then
  19. mv "$to.tmp" "$to" && echo "done!"
  20. else
  21. echo "$? oops, timeout or OOM?"
  22. exit 1
  23. fi
  24. else
  25. echo "already exists: $to, not recomputing"
  26. fi
  27. }
  28. # # Opgelet: kan traag zijn!!
  29. # #
  30. # # 0.01 en 0.001 duren erg lang voor BOFC
  31. # # Voor BOFC geen 100 nodig.
  32. # for eps in 40 10 1 0.1;
  33. # do
  34. # for points in 1000 2000 5000; # 7000; 7000 too expensive, always fails due to timeout
  35. # do
  36. # for k in 64 512 "$points";
  37. # do
  38. # #if [ "$k" -eq "7000" ]; then
  39. # # k=2000 # 7000 is too expensive to finish in a reasonable amount of time
  40. # #fi
  41. # # if [ "$k" -eq "5000" ]; then
  42. # # k=2000 # 7000 is too expensive to finish in a reasonable amount of time (with some exceptions)
  43. # # fi
  44. # for normalize in --normalize --no-normalize;
  45. # do
  46. # maybe_make_diffmap results_9010/PDL_9010 BOFC "$eps" "$points" "$k" "$normalize" 25
  47. # done
  48. # done
  49. # done
  50. # done
  51. # #Grrr
  52. #maybe_make_diffmap results_9010/PDL_9010 BOFC "0.01" "5000" 64 --no-normalize 10
  53. #python3 plot-diffusion-map.py --fit 300000 --ith-stem results_9010/PDL_9010 --interactive 'BOFC(k=64,eps=0.01,points=5000,--no-normalize,start-time=10).diffmap' BOFC "transformed scatterplot"
  54. #python3 plot-diffusion-map.py 'BOFC(k=64,eps=0.01,points=5000,--no-normalize,start-time=10).diffmap' BOFC "correlation plots"
  55. #maybe_make_diffmap results_9010/PDL_9010 BOFC "0.01" "5000" 64 --no-normalize 22
  56. #python3 plot-diffusion-map.py --fit 300000 --ith-stem results_9010/PDL_9010 --interactive 'BOFC(k=64,eps=0.01,points=5000,--no-normalize,start-time=22).diffmap' BOFC "transformed scatterplot"
  57. #python3 plot-diffusion-map.py --fit 300000 --ith-stem results_9010/PDL_9010 --interactive BOFC\(k=64,eps=0.01,p
  58. maybe_make_diffmap results_9010/PDL_9010 BOFC "0.01" "5000" 32 --no-normalize 10
  59. #python3 plot-diffusion-map.py --fit 300000 --ith-stem results_9010/PDL_9010 --interactive 'BOFC(k=64,eps=0.01,points=5000,--no-normalize,start-time=10).diffmap' BOFC "transformed scatterplot"
  60. python3 plot-diffusion-map.py 'BOFC(k=32,eps=0.01,points=5000,--no-normalize,start-time=10).diffmap' BOFC "transformed scatterplot"
  61. python3 plot-diffusion-map.py 'BOFC(k=32,eps=0.01,points=5000,--no-normalize,start-time=10).diffmap' BOFC "eigenvalues"
  62. # Maximal number of points: 45079875
  63. # Success: 2
  64. #sudo -E env PATH=$PATH systemd-run --scope -p MemoryAccounting=yes -p CPUAccounting=true -p MemorySwapMax=20M -p MemoryMax=4.8G -p CPUWeight=10 --uid=$USER --gid=$USER python3 plot-diffusion-map.py --ith-stem results_9010/PDL_9010 --fit 2000000 'BOFC(k=32,eps=0.01,points=5000,--no-normalize,start-time=10).diffmap' BOFC "transformed scatterplot"
  65. python3 plot-diffusion-map.py --axes 'BOFC(k=32,eps=0.01,points=5000,--no-normalize,start-time=10).diffmap' BOFC "correlation plots"
  66. #python3 plot-diffusion-map.py 'BOFC(k=32,eps=0.01,points=5000,--no-normalize,start-time=10).diffmap' BOFC --ith-stem results_9010/PDL_9010 --fit 5000 "transformed scatterplot"
  67. # Courtemanche. To avoid file name length limits on some systems,
  68. # Courtemanche2D is abbreviated to CM.
  69. maybe_make_diffmap myokit12/myokit_2 'CM-nospiral' 400 6000 6000 --normalize 22 # ?? all eigenvalues are approx -0.0025
  70. maybe_make_diffmap myokit_CMspiral3/myokit_5 'CM-spiral' 400 6000 6000 --normalize 27 # ???
  71. python3 plot-diffusion-map.py 'CM-nospiral(k=6000,eps=400,points=6000,--normalize,start-time=22).diffmap' CM-nospiral "transformed scatterplot"
  72. python3 plot-diffusion-map.py 'CM-spiral(k=6000,eps=400,points=6000,--normalize,start-time=27).diffmap' CM-spiral "transformed scatterplot"
  73. python3 plot-diffusion-map.py 'CM-nospiral(k=6000,eps=400,points=6000,--normalize,start-time=22).diffmap' CM-nospiral "correlation plots"
  74. python3 plot-diffusion-map.py 'CM-nospiral(k=6000,eps=400,points=6000,--normalize,start-time=22).diffmap' CM-nospiral "eigenvalues"
  75. python3 plot-diffusion-map.py 'CM-spiral(k=6000,eps=400,points=6000,--normalize,start-time=27).diffmap' CM-spiral "eigenvalues"
  76. # Transformed phaseplot
  77. #sudo -E env PATH=$PATH systemd-run --scope -p MemoryAccounting=yes -p CPUAccounting=true -p MemorySwapMax=20M -p MemoryMax=2.4G -p CPUWeight=10 --uid=$USER --gid=$USER python3 plot-diffusion-map.py --ith-stem myokit12/myokit_2 --fit 10000 'Courtemanche2D-nospiral(k=6000,eps=400,points=6000,--normalize,start-time=22).diffmap' Courtemanche2D-nospiral "transformed scatterplot"
  78. #python3 plot-diffusion-map.py 'Courtemanche2D-nospiral(k=6000,eps=400,points=6000,--normalize,start-time=22).diffmap' Courtemanche2D-nospiral "correlation plots"
  79. # AP model
  80. # 0.04 werkt
  81. # 0.03 werkt (wel trager)
  82. e=0.02
  83. maybe_make_diffmap phase_1000/phase_1000 'AP' "$e" 100 100 --no-normalize 2
  84. maybe_make_diffmap phase_1000/phase_1000 'AP' "$e" 200 200 --no-normalize 2
  85. maybe_make_diffmap phase_1000/phase_1000 'AP' "$e" 1000 1000 --no-normalize 2
  86. maybe_make_diffmap phase_1000/phase_1000 'AP' "$e" 3000 3000 --no-normalize 2
  87. maybe_make_diffmap phase_1000/phase_1000 'AP' "$e" 5000 5000 --no-normalize 2
  88. maybe_make_diffmap phase_1000/phase_1000 'AP' "$e" 6000 6000 --no-normalize 2
  89. #maybe_make_diffmap phase_1000/phase_1000 'AP' "$e" 7000 7000 --no-normalize 2
  90. # Plots for AP model
  91. python3 plot-diffusion-map.py "AP(k=6000,eps=$e,points=6000,--no-normalize,start-time=2).diffmap" AP --ith-stem phase_1000/phase_1000 "transformed scatterplot"
  92. python3 plot-diffusion-map.py "AP(k=6000,eps=$e,points=6000,--no-normalize,start-time=2).diffmap" AP --ith-stem phase_1000/phase_1000 "eigenvalues"
  93. python3 plot-diffusion-map.py "AP(k=6000,eps=$e,points=6000,--no-normalize,start-time=2).diffmap" AP --ith-stem phase_1000/phase_1000 "correlation plots"