Load Inverse Output

Loads the output values from the current inverse optimization iteration.

Endpoint

POST /models/{model_id}/projects/{project_id}/trials/{trial_id}/objectives/{objective_id}/inverse-output

Path Parameters

Parameter
Type
Required
Description

model_id

integer

Yes

ID of the model

project_id

integer

Yes

ID of the project

trial_id

integer

Yes

ID of the trial

objective_id

integer

Yes

ID of the objective

Request Parameters

Parameter
Type
Required
Description

output

array[float]

Yes

Output values from the current iteration (must match objective count)

Request Format

{
    "output": [98.5, 45.2, 22.1]
}

Response Format

{
    "id": 123,
    "iteration": 3,
    "status": "active",
    "convergence": 0.0015,
    "input": [1.1, 2.2, 3.3],
    "output": [98.5, 45.2, 22.1],
    "computeTime": 0.1,
    "suggestTime": 0.0,
    "createdAt": "2025-01-31T10:00:00.000Z",
    "updatedAt": "2025-01-31T10:00:00.000Z",
    "results": [
        {
            "number": 0,
            "type": "exact",
            "objective": 100.0,
            "minimumBound": null,
            "maximumBound": null,
            "output": 98.5,
            "error": 1.5,
            "detail": "Error exceeds L1 norm threshold",
            "satisfied": false
        },
        {
            "number": 1,
            "type": "lessthan",
            "objective": 50.0,
            "minimumBound": null,
            "maximumBound": null,
            "output": 45.2,
            "error": 0.0,
            "detail": "Output is less than target",
            "satisfied": true
        },
        {
            "number": 2,
            "type": "percent",
            "objective": 22.0,
            "minimumBound": -0.5,
            "maximumBound": 0.5,
            "output": 22.1,
            "error": 0.45,
            "detail": "Output within percent bounds",
            "satisfied": true
        }
    ]
}

Examples

from globalmoo import Client

client = Client(api_key="your-api-key")
result = client.load_inversed_output(
    model_id=123,
    project_id=456,
    trial_id=789,
    objective_id=12,
    output=[98.5, 45.2, 22.1]
)

print(f"Current convergence: {result.convergence}")
print(f"Status: {result.status}")
print(f"Compute time: {result.compute_time:.3f}s")

# Check objective satisfaction
print("\nObjective Results:")
for result in result.results:
    print(f"\nObjective {result.number}:")
    print(f"  Type: {result.type}")
    print(f"  Target: {result.objective:.4f}")
    print(f"  Output: {result.output:.4f}")
    print(f"  Error: {result.error:.6f}")
    print(f"  Satisfied: {'✓' if result.satisfied else '✗'}")
    print(f"  Detail: {result.detail}")

# Overall status
all_satisfied = all(r.satisfied for r in result.results)
print(f"\nOverall status: {'All objectives satisfied' if all_satisfied else 'Some objectives not met'}")

Error Responses

Status Code
Description

400

Invalid request - Invalid output format

401

Unauthorized - Invalid API key

404

Model, project, trial, or objective not found

409

Conflict - No active iteration

429

Too many requests - Rate limit exceeded

500

Internal server error

Validation Rules

  • Model, project, trial, and objective IDs must be positive integers

  • Output array must contain valid floating point numbers

  • Output array length must match the number of objectives

  • Trial must be in an active state

  • Previous iteration must be completed

  • An inverse optimization must be initialized for the trial

Last updated