comparison org/worm_learn.clj @ 516:ced955c3c84f

resurrect old cortex to fix flow issues.
author Robert McIntyre <rlm@mit.edu>
date Sun, 30 Mar 2014 22:48:19 -0400
parents 0a4362d1f138
children 01934317b25b
comparison
equal deleted inserted replaced
515:58fa1ffd481e 516:ced955c3c84f
446 (defn init [] 446 (defn init []
447 (def phi-space (generate-phi-space)) 447 (def phi-space (generate-phi-space))
448 (def phi-scan (gen-phi-scan phi-space)) 448 (def phi-scan (gen-phi-scan phi-space))
449 ) 449 )
450 450
451 ;; (defn infer-nils-dyl [s]
452 ;; (loop [closed ()
453 ;; open s
454 ;; anchor 0]
455 ;; (if-not (empty? open)
456 ;; (recur (conj closed
457 ;; (or (peek open)
458 ;; anchor))
459 ;; (pop open)
460 ;; (or (peek open) anchor))
461 ;; closed)))
462
463 ;; (defn infer-nils [s]
464 ;; (for [i (range (count s))]
465 ;; (or (get s i)
466 ;; (some (comp not nil?) (vector:last-n (- (count s) i)))
467 ;; 0)))
468
469 451
470 (defn infer-nils 452 (defn infer-nils
471 "Replace nils with the next available non-nil element in the 453 "Replace nils with the next available non-nil element in the
472 sequence, or barring that, 0." 454 sequence, or barring that, 0."
473 [s] 455 [s]
555 :worm worm*)) 537 :worm worm*))
556 (accuracy @res))) 538 (accuracy @res)))
557 539
558 540
559 541
560 542 (defn dylan-collect-bolts [longest-threads index-sets]
561 543 (fn
562 544 [experiences text]
545 (let [phi-indices (phi-scan (:proprioception (peek experiences)))
546 long-thread (longest-thread (vector:last-n @index-sets 300))]
547 (swap! index-sets #(conj % phi-indices))
548 (swap! longest-threads #(conj % long-thread)))))
549
550
551