{"id":34658600,"url":"https://github.com/molmod/sbc","last_synced_at":"2026-05-26T17:31:40.642Z","repository":{"id":266307125,"uuid":"868990546","full_name":"molmod/sbc","owner":"molmod","description":"learned collective variables using smooth basin classification","archived":false,"fork":false,"pushed_at":"2024-12-22T18:00:18.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-22T19:17:48.609Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/molmod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-07T14:30:01.000Z","updated_at":"2024-12-22T18:00:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"4242dbd5-b86e-4cee-adac-f3fcf0e035eb","html_url":"https://github.com/molmod/sbc","commit_stats":null,"previous_names":["molmod/sbc"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/molmod/sbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molmod%2Fsbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molmod%2Fsbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molmod%2Fsbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molmod%2Fsbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/molmod","download_url":"https://codeload.github.com/molmod/sbc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molmod%2Fsbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33531995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T18:37:35.617Z","updated_at":"2026-05-26T17:31:40.637Z","avatar_url":"https://github.com/molmod.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rare Event Sampling using Smooth Basin Classification ([arXiv:2404.03777](https://arxiv.org/abs/2404.03777))\n\nThis repository extends MACE with a classification layer in order to learn *rigorously invariant* collective variables for reactive and nonreactive rare events.\n\n![model](https://github.com/user-attachments/assets/403a75fb-849f-42b6-9f95-44c161278766)\n\n# Usage\n\nSBC works by augmenting existing MACE models (e.g. MACE-MP) with a phase readout layer whose weights are optimized using a custom cross-entropy loss function. Its training requires an XYZ dataset of atomic geometries which are annotated with a global `phase` label; no energies or forces are required. Compared to vanilla MACE, the train script implements the following additional keyword arguments:\n\n- `--base_model`: the existing MACE model which is to be augmented with a phase readout layer\n- `--classifier`: classifier architecture; for the moment, this should be set to `EnergyBasedClassifier`\n- `--classifier_readout`: layer sizes for the classifier readout. `[16, 8]` means that it will create two hidden layers with respective sizes 16 and 8 to convert the (scalar part of the) node embeddings into per-phase log probabilities.\n- `--classifier_mixing`: determines whether to mix features of different interaction layers in the readout.\n- `--uncertainty_weight`: weight of the regularization term in Equation 12 of the preprint. We found that a value of 1.0 works well for a variety of systems.\n\nSee below for an example:\n```sh\npython scripts/run_train_classifier.py \\\n    --name=\"MACE_model\" \\\n    --train_file=\"combined.xyz\" \\\n    --valid_fraction=0.1 \\\n    --config_type_weights='{\"Default\":1.0}' \\\n    --E0s='average' \\\n    --batch_size=512 \\\n    --valid_batch_size=64 \\\n    --max_num_epochs=10000 \\\n    --amsgrad \\\n    --restart_latest \\\n    --device=\"cuda\" \\\n    --save_cpu \\\n    --lr=0.01 \\\n    --patience=500 \\\n    --scheduler_patience=50 \\\n    --default_dtype=\"float32\" \\\n    --seed=2 \\\n    --loss='cross_entropy' \\\n    --energy_weight=1.0 \\\n    --error_table='cross_entropy' \\\n    --label_smoothing=0.0 \\\n    --scaling=\"no_scaling\" \\\n    --base_model=\"universal_mace.pth\" \\\n    --classifier='EnergyBasedClassifier' \\\n    --classifier_readout='[16, 8]' \\\n    --classifier_mixing=0 \\\n    --uncertainty_weight=1.0\n\n```\n\n# Setup\nCreate a Python environment with `torch`, and `mace` v0.3.0.\nNext, install `sbc` directly from Github using\n```sh\npip install git+https://github.com/molmod/sbc\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolmod%2Fsbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmolmod%2Fsbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolmod%2Fsbc/lists"}