figshare
Browse
AFVF_Examples.zip (87.15 MB)

HAFVF Julia Code

Download (87.15 MB) This item is shared privately
software
modified on 2018-08-17, 14:08
############ DISCLOSURE ############
#==================================#
This repository provides the code used to generate the datasets and figures of the paper "Learning and Forgetting Using Reinforced Bayesian Change Detection".
The current code was written for Julia v0.6.2. At the time of this writing, it seems like a lot of the syntax used here will be deprecated in the upcoming versions of Julia (v1.0).

This repository also provides custom early beta versions of toolboxes that are intended to be made available on GitHub in a near (or so) future:
- NDiffs: Symbolic differentiation + simplifications (somehow similar to XGrad)
- MyTools: Collection of useful tools (i.e. adding custom derivation rules to ForwardDiff, adding @forward pass to ReverseDiff for functions with >2 args, etc.)
- SupplementaryPlot: Some tools for PyPlot, such as plot of correlation slope etc.
- AFVFtools: Early (and pre-beta) version of Smoothing and AR models with HAFVF
- AdaWhatever: Julia implementation SGD algorithms (parallel and serial versions)
-> Adam, Adadelta, AdaGrad and ... AdaFVF :-)


############ Running Code ############
#====================================#
1. First, you will need to define and environment variable telling Julia where to look for the codes. In Linux/Unix, this is done by running
$ export JULIAmyHOME:/path/to/unpacked/folder/


2. Then, the following code should be ran when starting Julia:

julia> using Calculus,ForwardDiff,ReverseDiff,Distributions,StatsFuns,StatsBase,DiffResults
julia> (L->include.(string.(ENV["JULIAmyHOME"],"/MyTools/",L[map(x->x[end-2:end].==".jl",L)])))(
readdir(string(ENV["JULIAmyHOME"],"/MyTools/")))

Note that line 2 requires JULIAmyHOME to be defined, hence the first line of this procedure.

## Running the code of the results:
# Comparision with HGF: AFVF_Examples/tapasit.m for matlab running of HGF and data exportation
AFVF_Examples/tapasit.jl for Julia test of HAFVF on the dataset + generation of figure
# Strategies comparision: AFVF_Examples/strategies.jl
# Fitting the HAFVF: AFVF_Examples/afvf_bahav_example.jl and related files
# TD learning: AFVF_Exapmple/afvf_TD.jl