Coder Social home page Coder Social logo

deepsimulatedmoments.jl's Introduction

DeepSimulatedMoments

Documentation Build Status
Docs Build StatusCodecov

DeepSimulatedMoments.jl provides an implementation of the methods proposed in Constructing Efficient Simulated Moments Using Temporal Convolutional Networks by Chassot, J. and Creel, M. (2023). The package allows to define your own data-generating processes, set up and train neural networks to generate moment conditions and proceed with simulation-based inference. For information on how to use this package, please refer to the documentation

Quick Example

using DeepSimulatedMoments
using Flux # Flux provides the optimizer used in this example, ADAMW

# Create a moving-average process of order 2 with n=100 observations
dgp = MA2(100)
# Build a TCN to generate moment conditions for this DGP
tcn = build_tcn(dgp)

# Set up hyperparameters
hp = HyperParameters(
    validation_size=1_000, # Use 1'000 samples to validate the final network
    loss=rmse_conv, # The loss function to use in the training of the network
    nsamples=100, # Number of samples (of `n=100` observations) per epoch
    epochs=5, # Number of total epochs
    print_every=5, # Print train/test loss every 5 samples
    dev=cpu # Use the CPU as a device for the network
)

# Create the moment network
net = MomentNetwork(
    tcn |> hp.dev, # Specify the network to use and pass the TCN to the device
    hp, # Specify the hyperparameters used for training and validation
    ADAMW(), # Specify the optimizer used for training
    # Specify a transformation applied to the parameters of the DGP pre-training
    parameter_transform=datatransform(dgp, 100_000, dev=hp.dev)
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.