Inference
AdvancedHMC/AdvancedMH/AdvancedNUTS based inference
SubspaceInference.sub_inference — Methodsub_inference(in_model, data, W_swa, P; σ_z = 1.0, σ_m = 1.0, σ_p = 1.0, itr=100,
M = 3, alg = :rwmh, backend = :forwarddiff)To generate the uncertainty in machine learing models using MH Sampler from subspace
Input Arguments
in_model: Machine learning model. Eg: Chain(Dense(10,2)). Model should be created with Chain in Fluxdata: Inputs and outputs. Eg: X = rand(10,100); Y = rand(2,100); data = DataLoader(X,Y);W_swa: Mean WeightP: Projection Matrix
Keyword Arguments
σ_z: Standard deviation of subspaceσ_m: Standard deviation of likelihood modelσ_p: Standard deviation of prioritr: Iterations for samplingM: Maximum number of columns in deviation matrix. Eg: M= 3alg: Sampling Algorithm. Eg: :rwmhbackend: Differentiation backend. Eg: :forwarddiff
Output
chn: Chain with samples with uncertainty informationslp: Log probabilities of all samples
Autoencoder based inference
SubspaceInference.auto_inference — Methodauto_inference(m, data, decoder, W_swa; σ_z = 1.0,
σ_m = 1.0, σ_p = 1.0, itr=100, M = 3, alg = :hmc,
backend = :forwarddiff)To generate the uncertainty in machine learing or neural ODE models using auto-encoders
Input Arguments
m: Machine learning model. Eg: Chain(Dense(10,2)). Model should be created with Chain in Fluxdata: Inputs and outputs. Eg: X = rand(10,100); Y = rand(2,100); data = DataLoader(X,Y);decoder: Decoder to generate NN or Neural ODE parameters from subspaceW_swa: Mean Weight
Keyword Arguments
σ_z: Standard deviation of subspaceσ_m: Standard deviation of likelihood modelσ_p: Standard deviation of prioritr: Iterations for samplingM: Maximum number of columns in deviation matrix. Eg: M= 3alg: Sampling Algorithm. Eg: :rwmhbackend: Differentiation backend. Eg: :forwarddiff
Output
chn: Chain with samples with uncertainty informationslp: Log probabilities of all samples
Turing based inference
SubspaceInference.turing_inference — Methodturing_inference(m, data, W_swa, P; σ_z = 1.0,
σ_m = 1.0, σ_p = 1.0, itr=100, M = 3, alg = :turing_mh,
backend = :forwarddiff)To generate the uncertainty in machine learing or neural ODE models using auto-encoders
Input Arguments
m: Machine learning model. Eg: Chain(Dense(10,2)). Model should be created with Chain in Fluxdata: Inputs and outputs. Eg: X = rand(10,100); Y = rand(2,100); data = DataLoader(X,Y);W_swa: Mean WeightP: Projection Matrix
Keyword Arguments
σ_z: Standard deviation of subspaceσ_m: Standard deviation of likelihood modelσ_p: Standard deviation of prioritr: Iterations for samplingM: Maximum number of columns in deviation matrix. Eg: M= 3alg: Sampling Algorithm. Eg: :turing_mhbackend: Differentiation backend. Eg: :forwarddiff
Output
chn: Chain with samples with uncertainty informationslp: Log probabilities of all samples