aboutsummaryrefslogtreecommitdiffstats
path: root/src/NeuralNetworks.jl
diff options
context:
space:
mode:
authorScott Lawrence <scott+git@ineffectivetheory.com>2024-06-22 21:59:53 -0700
committerScott Lawrence <scott+git@ineffectivetheory.com>2024-06-22 21:59:53 -0700
commitfe6ca0140228bc45da14857566af86f72140f38c (patch)
tree8c68f8b8c561869c62ba5a92b8a39df906bd2e8a /src/NeuralNetworks.jl
parentcd972df86d691f9e514fca74651f12dae87b24f8 (diff)
downloadvatic-main.tar.gz
vatic-main.tar.bz2
vatic-main.zip
Progress toward MCMCHEADmain
Diffstat (limited to 'src/NeuralNetworks.jl')
-rw-r--r--src/NeuralNetworks.jl41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/NeuralNetworks.jl b/src/NeuralNetworks.jl
new file mode 100644
index 0000000..7bc9c5d
--- /dev/null
+++ b/src/NeuralNetworks.jl
@@ -0,0 +1,41 @@
+module NeuralNetworks
+
+struct Linear
+ W::Matrix{Float64}
+ b::Vector{Float64}
+end
+
+function (l::Linear)(x::Vector{Float64})
+end
+
+struct Activation
+end
+
+struct MLP
+end
+
+struct AffineCoupling
+end
+
+function (f::AffineCoupling)(x::Vector{Float64})::Float64
+ return 0.
+end
+
+struct RealNVP
+ layers::Vector{AffineCoupling}
+
+ function RealNVP()
+ layers = Vector{AffineCoupling}()
+ new(layers)
+ end
+end
+
+function (f::RealNVP)(x::Vector{Float64})::Float64
+ ldJ::Float64 = 0.
+ for l! in f.layers
+ ldJ += l!(x)
+ end
+ return ldJ
+end
+
+end