Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/client-python-emcee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
58 changes: 58 additions & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
11 changes: 10 additions & 1 deletion models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Loading