Run-posner.lisp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #|
  2. This code is to easily go through all the posner experiments
  3. |#
  4. ;; 1. Set stuff up
  5. (setf *default-pathname-defaults*
  6. ;;#P"/home/laurab/common-lisp/gems-1.2-alpha-3/posner/")
  7. #P"/Users/bartletl/Documents/portacle/projects/gems-1.2-alpha-3/posner/")
  8. (require :asdf)
  9. (require :gems)
  10. ;; 2. Enter the names of the experiments to be included
  11. (setf experiment-list (list 'arjona))
  12. ;; 3. Go through each and run GP
  13. (load "posner-initialise.lisp")
  14. ;; optional things:
  15. (setf decay-toggle 0) ;; stm decay on (1) or off (0)
  16. (setf *decay-threshold* 0.1) ;; just try different values
  17. (defparameter stored-state (make-random-state t)) ;; this is a new one every time. so need to actually store it somewhere.
  18. (setf *random-state* (make-random-state stored-state))
  19. ;; this info will be printed in the output file and so can be used in future.
  20. (dolist (name-exp experiment-list)
  21. (load (format nil "posner-~a.lisp" name-exp))
  22. (defun operator-set () op-set)
  23. (run-gp :f-a 0.7 ;; changed from 0.75
  24. :f-t 0.25
  25. :f-s 0.05 ;;changed from 0.05
  26. :population-size 5000 ;; change from 3000 ; 8000 ; 2000
  27. :max-generations 500 ;; change from 200 ; 700 ; 500
  28. :phased t
  29. :logger (gems:combine-loggers (gems:make-logger (format nil "summary-~a-prev.csv" name-exp) :if-exists :supersede) (gems:make-logger (format nil "models-~a-prev.yml" name-exp) :kind :trace :filter #'(lambda (generation-number) (= generation-number *max-generations*)))))
  30. )
  31. (defun operator-set () (append op-set wait-op-set))
  32. (load (format nil "posner-~a.lisp" 'arjona))
  33. (setf clean-models-arjona (best-models "models-arjona.yml"))
  34. (print (format nil "~a final models - ~a" (length clean-models-arjona) 'Arjona))