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
| abstract type Countable{sym} end | |
| Base.show(io::IO, x::Countable{sym}) where sym = print(io, x.n == 1 ? "$sym" : "$(x.n)$sym") | |
| getsym(x::Countable{sym}) where sym = sym | |
| Base.:*(n::Integer, x::Countable) = typeof(x)(n * x.n) | |
| Base.:+(a::Countable, b::Countable) = error("Can't add $(getsym(a))s and $((getsym(b)))s") | |
| Base.:+(a::T, b::T) where {T<:Countable} = T(a.n + b.n) |
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
| using Flux, StatsBase, Symbolics, SparseArrays, StaticArrays, Functors, BenchmarkTools | |
| # Simple dummy ML classifier model: | |
| ninputs = 10 | |
| nlatent = 40 | |
| model = Chain( | |
| Dense(ninputs => nlatent, relu), | |
| Dense(nlatent => nlatent, relu), |
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
| using Cxx | |
| cxx""" | |
| #include <iostream> | |
| class MyClass { | |
| public: | |
| int i = 0; | |
| MyClass() { std::cerr << "INFO: MyClass()" << std::endl; } | |
| MyClass(int j) : i(j) { std::cerr << "INFO: MyClass(" << i << ")" << std::endl; } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| # Copyright (C) 2016 Oliver Schulz <[email protected]> | |
| # Licensed under the MIT License: http://opensource.org/licenses/MIT | |
| # Note: Currently only works with ROOT-5, not ROOT-6, due to LLVM clashes | |
| # between Cling and Julia. | |
| using Cxx | |
| using Distributions | |
| incdir = strip(readall(`root-config --incdir`)) |
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
| # Copyright (C) 2016 Oliver Schulz <[email protected]> | |
| # Licensed under the MIT License: http://opensource.org/licenses/MIT | |
| # Note: Currently only works with ROOT-5, not ROOT-6, due to LLVM clashes | |
| # between Cling and Julia. | |
| using Cxx | |
| using Distributions | |
| incdir = strip(readall(`root-config --incdir`)) |