diff --git a/.github/workflows/client-python-emcee.yml b/.github/workflows/client-python-emcee.yml index e3fb38f0..cd185e80 100644 --- a/.github/workflows/client-python-emcee.yml +++ b/.github/workflows/client-python-emcee.yml @@ -28,7 +28,7 @@ jobs: apt update && DEBIAN_FRONTEND="noninteractive" apt install -y python3-pip python3-venv python3 -m venv venv . venv/bin/activate - pip3 install numpy arviz emcee umbridge + pip3 install numpy arviz emcee umbridge matplotlib - name: Build and run run: | diff --git a/lib/README.md b/lib/README.md index a9788927..6e7805dd 100644 --- a/lib/README.md +++ b/lib/README.md @@ -175,6 +175,25 @@ Output key | Value type | Purpose -----------------|------------------|------------- output | Array of numbers | Gradient of objective +Input example: +```json +{ + "name": "posterior", + "inWrt": 0, + "outWrt": 0, + "sens": [1.1], + "input": [[0.0, 0.0]], + "config": {} +} +``` + +Output example: +```json +{ + "output":[-0.01957508257895159, 0.01957508257895159] +} +``` + ### POST /ApplyJacobian Input key | Value type | Purpose @@ -190,6 +209,25 @@ Output key | Value type | Purpose -----------------|------------------|------------- output | Array of numbers | Jacobian of output `outWrt` with respect to input parameter `inWrt` applied to vector `vec` +Input example: +```json +{ + "name": "posterior", + "inWrt": 0, + "outWrt": 0, + "vec": [1.1, 0.5], + "input": [[0.0, 0.0]], + "config": {} +} +``` + +Output example: +```json +{ + "output":[-0.01067731777033723] +} +``` + ### POST /ApplyHessian Input key | Value type | Purpose @@ -207,6 +245,26 @@ Output key | Value type | Purpose -----------------|------------------|------------- output | Array of numbers | Hessian at `input` applied to vector `vec` +```json +{ + "name": "posterior", + "inWrt1": 0, + "inWrt2": 0, + "outWrt": 0, + "vec": [1.1, 0.5], + "sens": [0.1], + "input": [[0.0, 0.0]], + "config": {} +} +``` + +Output example: +```json +{ + "output":[-0.27076762180664354] +} +``` + ### Errors Each endpoint may return errors, indicated by error codes (i.e. 400 for user errors, 500 for model side errors) and a JSON structure giving more detailed information. The following error types exist: diff --git a/models/README.md b/models/README.md index bb2d3d81..732114f4 100644 --- a/models/README.md +++ b/models/README.md @@ -24,7 +24,15 @@ docker run -p 4242:4242 linusseelinger/model-testmodel-python:latest ## Implementation -A model may make use of the existing integrations below. They take care of the entire HTTP communication transparently, and provide easy to implement model interfaces. Refer to the models in this repository for working examples of the server integrations shown in the following. +A model may make use of the existing integrations below. They take care of the entire HTTP communication transparently, and provide easy to implement model interfaces. However, there are some features that are language specific. The table below briefly summarises these differences. + +| Implementation | Optional Error Checks | Allow Parallel Requests | Allow `Inf` & `NaN` Output | +|----------------|-----------------------|-------------------------|----------------------------| +| Python | Yes | Yes | WIP | +| C++ | Yes | Yes | No | +| Julia | No | Yes | Yes | + +Refer to the models in this repository for working examples of the server integrations shown in the following. ### Python server @@ -159,6 +167,7 @@ testmodel = UMBridge.Model(name="forward", inputSizes=[1], outputSizes=[1]) UMBridge.define_evaluate(testmodel, evaluate) UMBridge.serve_models([testmodel], 4232) ``` +[Full example sources here.](https://github.com/UM-Bridge/umbridge/tree/main/models/testmodel-julia) ## MUQ server