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
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
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'}")const { Client } = require('globalmoo');
const client = new Client('your-api-key');
const result = await client.loadInversedOutput({
    modelId: 123,
    projectId: 456,
    trialId: 789,
    objectiveId: 12,
    output: [98.5, 45.2, 22.1]
});
console.log(`Current convergence: ${result.convergence}`);
console.log(`Status: ${result.status}`);
console.log(`Compute time: ${result.computeTime.toFixed(3)}s`);
// Check objective satisfaction
console.log('\nObjective Results:');
result.results.forEach(result => {
    console.log(`\nObjective ${result.number}:`);
    console.log(`  Type: ${result.type}`);
    console.log(`  Target: ${result.objective.toFixed(4)}`);
    console.log(`  Output: ${result.output.toFixed(4)}`);
    console.log(`  Error: ${result.error.toFixed(6)}`);
    console.log(`  Satisfied: ${result.satisfied ? '✓' : '✗'}`);
    console.log(`  Detail: ${result.detail}`);
});
// Overall status
const allSatisfied = result.results.every(r => r.satisfied);
console.log(`\nOverall status: ${allSatisfied ? 'All objectives satisfied' : 'Some objectives not met'}`);$client = new Client("your-api-key");
$result = $client->loadInversedOutput([
    "modelId" => 123,
    "projectId" => 456,
    "trialId" => 789,
    "objectiveId" => 12,
    "output" => [98.5, 45.2, 22.1]
]);
echo "Current convergence: " . $result->convergence . "\n";
echo "Status: " . $result->status . "\n";
echo "Compute time: " . number_format($result->computeTime, 3) . "s\n";
// Check objective satisfaction
echo "\nObjective Results:\n";
foreach ($result->results as $obj) {
    echo "\nObjective " . $obj->number . ":\n";
    echo "  Type: " . $obj->type . "\n";
    echo "  Target: " . number_format($obj->objective, 4) . "\n";
    echo "  Output: " . number_format($obj->output, 4) . "\n";
    echo "  Error: " . number_format($obj->error, 6) . "\n";
    echo "  Satisfied: " . ($obj->satisfied ? '✓' : '✗') . "\n";
    echo "  Detail: " . $obj->detail . "\n";
}
// Overall status
$allSatisfied = array_reduce($result->results, function($carry, $item) {
    return $carry && $item->satisfied;
}, true);
echo "\nOverall status: " . ($allSatisfied ? 'All objectives satisfied' : 'Some objectives not met') . "\n";Error Responses
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