Skip to content

Instantly share code, notes, and snippets.

View nirmal-suthar's full-sized avatar
:octocat:

Nirmal Suthar nirmal-suthar

:octocat:
View GitHub Profile
@nirmal-suthar
nirmal-suthar / cnf_2d.jl
Last active August 12, 2020 10:00
FFJORD for 2D distribution
using DiffEqFlux, OrdinaryDiffEq, Flux, Optim, Distributions, Zygote, JLD, Distances, LinearAlgebra
nn = Chain(Dense(2,8,tanh), Dense(8,8,tanh), Dense(8,2))
# data_train = rand(Normal(), 1, 200) .|> Float32
tspan = (0.f0,10.f0)
ffjord_test = FFJORD(nn,tspan,Tsit5())
function loss_adjoint(θ)
# angles = rand(Float32,1,100) .* (Float32(2pi))
# data_train = vcat(sin.(angles),cos.(angles)) .* (0.5 .* rand(Float32,1,100))