How to use:
./wordle.sh
Or try the unlimit mode:
| using Cassette, ReplMaker | |
| Cassette.@context NoNaN | |
| nonnan(s, x::Number) = (@assert(!isnan(x), string(s, " returned NaN")); x) | |
| nonnan(s, A::AbstractArray) = (foreach(x->nonnan(s, x), A); A) | |
| nonnan(s, x) = x | |
| Cassette.overdub(::NoNaN, f, args...) = nonnan("$f$args", f(args...)) |
| module HoistMem | |
| export hoist_alloc, Buffer | |
| using Cassette, LinearAlgebra | |
| using Cassette: @context, overdub | |
| @context BuffCtx | |
| mutable struct Buffer |
| using Cassette, Test | |
| using Cassette: @context, enabletagging, @overdub, overdub, recurse, | |
| hasmetadata, metadata, tag, untag | |
| using ChainRules: frule, Zero, extern | |
| @context DiffCtx | |
| Cassette.metadatatype(::Type{<:DiffCtx}, ::Type{T}) where {T<:Real} = T | |
| function D(f, x) |
| #= | |
| These examples use ArbNumerics v0.4.4, no earlier version supports `exp(matrix)`. | |
| So, either first do `pkg> up` or do `pkg> rm ArbNumerics` then `pkg> add ArbNumerics`. | |
| Sometimes, rebuilding with `pkg> build ArbNumerics` cleans up after itself. | |
| All the matrix handling is new code, the examples here are working as of now. | |
| If you find anything unclear or something awry, post an issue and | |
| please use slack's direct message to draw my attention. | |
| =# | |
| #= |
| # Here I store more data as I go, | |
| # which I could use to plot figures comparing methods | |
| # the convergence speed of different methods | |
| # I use the Rosenbrock classic example and | |
| # Optim.jl as an iterative process which will | |
| # call f multiple times to find its minimum | |
| # and I plot the convergence vs time | |
| using Optim, Cassette |
| #!/bin/bash | |
| # project: build_oct | |
| # version: 1.12 (2023-01-01) | |
| # authors: C. Himpe (0000-0003-2194-6754), M. Koehler (0000-0003-2338-9904) | |
| # license: BSD-2-Clause License (opensource.org/licenses/BSD-2-Clause) | |
| # summary: Build Octave and numerical dependencies from source (in Ubuntu 20.04 with GCC >= 10.3). | |
| # requires hardware: either X86-64 with AVX2 or ARM64 with NEON. | |
| # requires software packages: octave libpcre2-dev libreadline-dev libgmp3-dev libmpfr-dev libfreetype6-dev libgl2ps-dev libfontconfig1-dev libglu1-mesa-dev |
| using PyCall | |
| # Change that to whatever packages you need. | |
| const PACKAGES = ["pyyaml"] | |
| # Import pip | |
| try | |
| @pyimport pip | |
| catch | |
| # If it is not found, install it |