ServerlessBayes

Coinfer.ServerlessBayes.AnonymousCloudFunction
struct AnonymousCloudFunction
Contains data used when running model in cloud. New models won’t be saved in the server.
  • project_dir::String: The directory which contains the project source code and data. Default:
  • entrance_file::String: The file which defines the required model function. Default: main.jl
  • entrance_func::String: The name of the function to run. Default: main
  • project_file::String: The julia project file. Default: Project.toml
  • manifest_file::String: The julia project manifest file. Default: Manifest.toml
  • endpoint::String: Endpoints configuration Default: default_endpoints()
source Coinfer.ServerlessBayes.CloudFunction
struct CloudFunction <: Coinfer.ServerlessBayes.CloudData
Contains data used when running model in cloud. New models will be saved in the server.
  • model_id::String: Model ID Default:
  • project_dir::String: The directory which contains the project source code and data. Default:
  • entrance_file::String: The file which defines the required model function. Default: main.jl
  • entrance_func::String: The name of the function to run. Default: main
  • project_file::String: The julia project file. Default: Project.toml
  • manifest_file::String: The julia project manifest file. Default: Manifest.toml
  • endpoint::String: Endpoints configuration Default: default_endpoints()
source Coinfer.ServerlessBayes.LocalFunction
struct LocalFunction
Contains data used when running model locally.
  • model_id::String: Model ID Default:
  • project_dir::String: The directory which contains the project source code and data. Default:
  • entrance_file::String: The file which defines the required model function. Default: main.jl
  • entrance_func::String: The name of the function to run. Default: main
  • project_file::String: The julia project file. Default: Project.toml
  • manifest_file::String: The julia project manifest file. Default: Manifest.toml
  • endpoint::String: Endpoints configuration Default: default_endpoints()
source Coinfer.ServerlessBayes.evaluate run any function locally or remotely
evaluate(func; args, kwargs, executor, other_kwargs...)

  • func:: the config used to locate the function
  • args:: the args used to invoke the function
  • kwargs:: the keyword args used to invoke the function
  • sample_args:: if the function returns a model, then you may provide additional args for sampling
  • sample_kwargs:: if the function returns a model, then you may provide additional keyword args for sampling
Example run code Only simple arguments that can be serialized and deserialized using JSON directly should be passed in entrance_args and entrance_kwargs. For complex arguments, you need to convert them to simple forms before calling evaluate. In your entrance_func, you will then need to convert them back to their original complex forms. The return value of the entrance_func will be printed to stdout when executed locally, or it will be sent to the experiment logs when run remotely. It is essential to ensure that the return value contains only simple data structures that can be serialized using JSON. source Coinfer.ServerlessBayes.sample Run sample on specified model which generate multiple chains.
sample(rng, model, N; ...)
sample(rng, model, N, parallel; ...)
sample(
    rng,
    model,
    N,
    parallel,
    nchains;
    use_script,
    experiment_id,
    executor,
    sample_kwargs...
)

  • rng::StableRNG. The random number generator. Currently only StableRNG is supported.
  • model::LocalFunction|CloudFunction|AnonymousCloudFunction. The model meta info.
  • parallel::MCMCThreads|MCMCDistributed|MCMCSerial. The algorithm for sampling MCMC chains.
  • N::Int. iteration count.
  • nchains::Int. Number of chains.
  • use_script::Bool. whether to use the script mode or not. In script there will be a script file generated from the parameters of this function and this script will be run in the server side.
  • experiment_id::String. The experiment id.
  • executor::String. The executor to use: fargate|lambda.
Example source

CoinferLogger

Coinfer.CoinferLogger.Experiment
Experiment
Select experiment on the server. Generally, an experiment is created by calling create_experiment rather than constructed explicitly. source Coinfer.CoinferLogger.Logger
Logger
Withdata’s Logger, which sends sample data onto the server. source Coinfer.CoinferLogger.Server
Server("http://dev.withdata.io")
The type represents a Withdata Server. source Coinfer.CoinferLogger.User
User(server, "an_authentication_token")
Specify which user to use on the server. The authentication token can be found on the user profile page on the server. source Base.fetch
fetch(xp::Experiment) -> Experiment
Fetch the sample data and log of the given experiment from the server. source Coinfer.CoinferLogger.create_experiment
create_experiment(user) -> Experiment
Create a new experiment on the server. With an experiment, one can create a Logger, which delivers the sample data to that experiment. source Coinfer.CoinferLogger.experiments
experiments(user) -> [Experiment]
Get all experiments on the server for the user. source