Getting started with Coinfer
Coinfer consists of three parts:- The Cloud Service.
- The Coinfer.jl Julia package.
- The Coinfer.js Javascript SDK.
Create API Token
First, let’s create a token in the Coinfer website:- Open this URL with you browser:
https://coinfer/bayes/
. - Click “Sign in with Auth0”.
- After successfully login to Coinfer website, click your account logo at the bottom left corner of the web page.
- Choose “Profile” > “Create Token”.
- Set you
COINFER_AUTH_TOKEN
environment variable to the new token created:export COINFER_AUTH_TOKEN=<newtoken>
Create Model Project
Create a new directory for our demo project and then change the current working directory to it:main.jl
and type in the following:
model
. This function need to return the model instance and the sampler we want to use in the experiment.
run_model.jl
. First we need to create a structure which contains
the information to locate the model entrypoint. We do this by call the create_model
fucntion. This function takes three positional functions:
- The type of the model. We specify
CloudFunction
here. This means the model will be run in the cloud environment instead of our local environment. Other possible values areAnonymousCloudFunction
,LocalFunction
. The meaning of them can be found in the document. - The project directory.
- The endpoints infomation. We create a Endpoints structure without any parameters. This means use the default server address hardcoded in the Endpoints source code. If you have your server, you can specify it’s address like this:
Endpoints("https://my.endpoints.url")
sample
to run the model.
Run
To run the script, we need to add the dependecies to the Julia project:Inspect the Sample Data
To get the experiment running details, you can log in to the Coinfer website and then click the “Experiment” tab on the left panel of the page. Usually your new experiment will be the first item in the list. Click on the experiment name, and you will see the experiment detail page. You can also use the experiment ID to construct the URL as follows to directly open the experiment detail page:https://coinfer.ai/bayes/#/experiment/[experiment_id]
The experiment detail page can be divided into three parts. The top-left area is the list of chains. The variable names list is under it. The large area on the right is the main content area to display various information.