This file contains 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
[tool.poetry] | |
name = "example-project" | |
version = "0.1.0" | |
description = "" | |
authors = ["Test Name <test@gmail.com>"] | |
[tool.poetry.dependencies] | |
python = "~3.10" | |
jax = [ | |
{version="0.4.21", extras=["cuda11_pip"], platform="linux"}, |
This file contains 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
struct FilteredWalk{F, T, G} | |
filter_set::F | |
prune::T | |
rebuilder::G | |
end | |
FilteredWalk(filter_set; prune = identity, rebuilder = identity) = | |
FilteredWalk(filter_set, prune, rebuilder) | |
function (walk::FilteredWalk)(recurse, x, ys...) | |
children, re = Functors.functor(x) |
This file contains 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 - editing it directly is not advised | |
julia_version = "1.7.2" | |
manifest_format = "2.0" | |
[[deps.AbstractFFTs]] | |
deps = ["ChainRulesCore", "LinearAlgebra"] | |
git-tree-sha1 = "6f1d9bc1c08f9f4a8fa92e3ea3cb50153a1b40d4" | |
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" | |
version = "1.1.0" |
This file contains 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 - editing it directly is not advised | |
julia_version = "1.7.2" | |
manifest_format = "2.0" | |
[[deps.AbstractFFTs]] | |
deps = ["ChainRulesCore", "LinearAlgebra"] | |
git-tree-sha1 = "6f1d9bc1c08f9f4a8fa92e3ea3cb50153a1b40d4" | |
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" | |
version = "1.1.0" |
This file contains 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
using Random: shuffle! | |
using Base: @nexprs, @ntuple | |
function _splitobs(lm::Dict{T,Vector{I}}, at::AbstractFloat) where {T,I<:Integer} | |
0 < at < 1 || throw(ArgumentError("the parameter \"at\" must be in interval (0, 1)")) | |
n = mapreduce(length, +, values(lm)) | |
k = length(keys(lm)) | |
# preallocate the indices vectors | |
idx1 = Vector{I}() | |
idx2 = Vector{I}() |
This file contains 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
MDSRC = $(wildcard ./markdown/*.md) | |
BIB = ./ref.bib | |
TEXPATH = ./tex | |
TEXSRC = main | |
OUTDIR = ./output | |
debug: | |
@echo $(MDSRC) | |
@echo $(MDOUT) |
This file contains 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
using DiffEqFlux, OrdinaryDiffEq, Flux, Printf | |
using Flux.Losses: logitcrossentropy | |
using Flux.Data: DataLoader | |
using MLDatasets | |
using MLDataUtils: LabelEnc, convertlabel, stratifiedobs | |
using CUDA | |
CUDA.allowscalar(false) | |
function loadmnist(batchsize = bs, train_split = 0.9) | |
# Use MLDataUtils LabelEnc for natural onehot conversion |
This file contains 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
struct OptionAIdentity | |
pool::MaxPool | |
end | |
OptionAIdentity(scale::Integer) = OptionAIdentity(MaxPool((scale, scale))) | |
OptionAIdentity(scale::Tuple{<:Integer, <:Integer}) = OptionAIdentity(MaxPool(scale)) | |
function (op::OptionAIdentity)(x, y) | |
z = op.pool(y) | |
npadchannels = size(x, 3) - size(z, 3) | |
return (npadchannels > 0) ? cat(z, zeros(Float32, size(z, 1), size(z, 2), npadchannels, size(z, 4)); dims = 3) : z |
This file contains 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
TREE: bitstream.types.SBitstream.sqrt(x)(SimulationId("bitstream.types.SBitstream", "x")) | |
TRANSFORM: /Users/darsnack/Code/BitSAD/BitBench/IterativeSVD/IterativeSVD.scala | |
TREE: var z: bitstream.types.SBitstream = bitstream.types.SBitstream.sqrt(x)(SimulationId("bitstream.types.SBitstream", "x")) | |
TREE: { | |
var z: bitstream.types.SBitstream = bitstream.types.SBitstream.sqrt(x)(SimulationId("bitstream.types.SBitstream", "x")); | |
var b: bitstream.types.SBitstream = z.$plus(y)(SimulationId("z", "y")); | |
b | |
} | |
TREE: ({ | |
var z: bitstream.types.SBitstream = bitstream.types.SBitstream.sqrt(x)(SimulationId("bitstream.types.SBitstream", "x")); |
This file contains 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
package bitstream.macros | |
import scala.language.experimental.macros | |
import scala.reflect.macros.blackbox.Context | |
object Macros { | |
def simulatable[T](expr: T): Any = macro simulatable_impl[T] | |
def simulatable_impl[T](c: Context)(expr: c.Expr[T]): c.Expr[T] = { |
NewerOlder