This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; UCT Monte Carlo Tree Search | |
(defpackage :uct | |
(:use :common-lisp :alexandria :serapeum) | |
(:import-from :nuddy #:⊥)) | |
(in-package :uct) | |
(defstruct search-tree | |
(mode :tree :type (member :tree :playout)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defpackage bo | |
(:use :common-lisp :alexandria :serapeum :trivia)) | |
(in-package :bo) | |
;;;; Bayesian Optimization based on Tree-structured Parzen Estimator and naive-Bayes. | |
;;; | |
;;; based on Rust code at https://docs.rs/tpe/0.1.1/tpe/ | |
;;; which is inspired by https://optuna.org/ | |
;;; which is inspired by http://hyperopt.github.io/hyperopt/ | |
;;; which is described in https://proceedings.neurips.cc/paper/2011/file/86e8f7ab32cfd12577bc2619bc635690-Paper.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; SBCL integration with Linxu perf jitdump interface | |
(defpackage :sbperf | |
(:use :common-lisp)) | |
(in-package :sbperf) | |
;;;; perf map | |
(defun write-perfmap () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; Double float math | |
(defparameter *standard-operators* | |
'(+ - * / 1+ 1- exp expt log sqrt abs | |
sin cos tan cis asin acos | |
atan sinh cosh tanh asinh acosh atanh)) | |
(defmacro defwrappers (type prefix &optional (operators *standard-operators*)) | |
"Define TYPE-specific macros for OPERATORS named with PREFIX. | |
The prefixed operators coerce all values (operands and results) to TYPE." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro def.wrapper (f args) | |
"Make (.F ARGS...) a double-float version of (F ARGS...)." | |
(flet ((coercer (x) `(coerce ,x 'double-float))) | |
`(defun ,(symbolicate "." f) ,args | |
,(coercer `(,f ,@(mapcar #'coercer args)))))) | |
(def.wrapper + (x y)) | |
==> | |
(DEFUN .+ (X Y) | |
(COERCE (+ (COERCE X 'DOUBLE-FLOAT) (COERCE Y 'DOUBLE-FLOAT)) 'DOUBLE-FLOAT)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BO> (sb-sprof:reset) | |
; No value | |
BO> (sb-sprof:with-sampling () | |
(time (hyper-test :n 400))) | |
Evaluation took: | |
5.349 seconds of real time | |
5.552335 seconds of total run time (5.392896 user, 0.159439 system) | |
[ Run times consist of 0.644 seconds GC time, and 4.909 seconds non-GC time. ] | |
103.80% CPU | |
10,657,575,260 processor cycles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is machine generated. Do not edit it! | |
{ fetchurl }: | |
let | |
qlReleases = | |
{ | |
"1am" = { | |
archive = fetchurl { | |
url = "http://beta.quicklisp.org/archive/1am/2014-11-06/1am-20141106-git.tgz"; | |
sha256 = "0vnnqd4fiq9z34i1k9gqczg3j6xllwba1f6nx0b82sgsdccmsly6"; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env nix-shell | |
#! nix-shell bootstrap.nix --run generate | |
# This script uses ql2nix to generate dependency definitions as Nix | |
# expressions in the current directory. Quicklisp and all packages are | |
# installed in a temporary directory. | |
# Quicklisp packages default root set. | |
let default-packages = [ | |
"1am" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/code/print.lisp b/src/code/print.lisp | |
index 92fbb3e76..be4e0037d 100644 | |
--- a/src/code/print.lisp | |
+++ b/src/code/print.lisp | |
@@ -568,8 +568,8 @@ variable: an unreadable object representing the error is printed instead.") | |
code (char-code current) | |
bits (cond ; FIXME | |
((< code 160) (aref attributes code)) | |
- ((upper-case-p current) uppercase-attribute) | |
- ((lower-case-p current) lowercase-attribute) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defparameter *brackets* | |
"()[]{}⦅⦆⦅⦆〚〛⦃⦄⟦⟧⟨⟩⟪⟫⟮⟯⟬⟭⌈⌉⌊⌋⦇⦈⦉⦊❨❩❪❫❴❵❬❭❮❯❰❱❲❳〈〉⦑⦒⧼⧽") | |
(loop for i from 0 below (length *brackets*) by 2 | |
for open = (elt *brackets* i) | |
for close = (elt *brackets* (1+ i)) | |
do (format t "~&pairing ~a with ~a~%" open close) | |
do (set-syntax-from-char close #\)) | |
do (set-macro-character close (get-macro-character #\)) nil) | |
do (set-macro-character open |