Tools · Custom Modeling
MPNN Models
On this page
Prices, workflows, and method papersOpen in the app
Run it from the API
Submit with Submit a job and the job_type below. Price it first with Estimate job reservation cost: submitting reserves that amount from your wallet, and the charge settles at the actual runtime.
MPNN Model Training train-mpnn
- Job type
train-mpnn- Hardware
cpu(default)t4l4a10- Typical runtime
- 1 h on CPU
Payload
| Field | Type | Description |
|---|---|---|
model_namerequired | string | Limits: |
input_data[]required | string[] | Limits: |
input_formatrequired | string | Limits: |
targets[]required | number[] | Limits: |
unit | string | Unit of the targets (e.g. kcal/mol); returned with every prediction from the trained model. |
model_description | string | Free-text description stored with the trained model. |
tags[] | string[] | Labels stored with the trained model. |
model_params | object | Optional architecture and training settings: mp_hidden_dim, mp_depth, n_ffn_layers, ffn_hidden_dim, n_epochs, batch_size, validation_size, random_seed, featureset, generate_3d, add_hydrogens, remove_hydrogens and learning_rate. learning_rate (default 0.001) is the peak of Chemprop's learning-rate schedule: it ramps linearly from learning_rate/10 to learning_rate over the first 5 epochs, then decays exponentially back to learning_rate/10 by the last epoch. Predictions with the trained model reuse its featureset and hydrogen settings. |
Example
from cognichem_client import CogniChem
client = CogniChem.from_env() # reads COGNICHEM_API_KEY
payload = {
"model_name": "mr38-tiny",
"input_data": ["CCO", "CCC", "CCN", "c1ccccc1", "CC", "… 3 more"],
"input_format": "smiles",
"targets": [1, 2, 1.5, 0.5, 1.1, "… 3 more"],
"model_params": {
"validation_size": 0.25,
"mp_hidden_dim": 32,
"mp_depth": 1,
"n_ffn_layers": 1,
"ffn_hidden_dim": 32,
"learning_rate": 0.001,
"n_epochs": 6,
"batch_size": 2,
},
}
estimate = client.jobs.estimate(job_type="train-mpnn", payload=payload, resource="cpu")
print(f"Reserves ${estimate.cost:.2f}")
job = client.jobs.submit(
job_name="my-train-mpnn-run",
job_type="train-mpnn",
payload=payload,
resource="cpu",
)
status = client.jobs.wait(job.process_id)
if status.status == "completed":
client.jobs.result(job.process_id, save_path=".")curl -X POST "https://api.cognichem.com/api/v1/jobs/submit" \
-H "X-Api-Key: $COGNICHEM_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"job_name": "my-train-mpnn-run",
"job_type": "train-mpnn",
"payload": {
"model_name": "mr38-tiny",
"input_data": [
"CCO",
"CCC",
"CCN",
"c1ccccc1",
"CC",
"… 3 more"
],
"input_format": "smiles",
"targets": [
1,
2,
1.5,
0.5,
1.1,
"… 3 more"
],
"model_params": {
"validation_size": 0.25,
"mp_hidden_dim": 32,
"mp_depth": 1,
"n_ffn_layers": 1,
"ffn_hidden_dim": 32,
"learning_rate": 0.001,
"n_epochs": 6,
"batch_size": 2
}
},
"resource": "cpu"
}'{
"model_name": "mr38-tiny",
"input_data": [
"CCO",
"CCC",
"CCN",
"c1ccccc1",
"CC",
"… 3 more"
],
"input_format": "smiles",
"targets": [
1,
2,
1.5,
0.5,
1.1,
"… 3 more"
],
"model_params": {
"validation_size": 0.25,
"mp_hidden_dim": 32,
"mp_depth": 1,
"n_ffn_layers": 1,
"ffn_hidden_dim": 32,
"learning_rate": 0.001,
"n_epochs": 6,
"batch_size": 2
}
}Sample data from the job catalog; long values are shortened here. Each job_name must be unique among your jobs.
Workflow inputs
- Molecules (list)SMILES
Workflow outputs
- ArchiveZIP