neurogen 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- neurogen-0.1.0/LICENSE +202 -0
- neurogen-0.1.0/PKG-INFO +222 -0
- neurogen-0.1.0/README.md +191 -0
- neurogen-0.1.0/pyproject.toml +92 -0
- neurogen-0.1.0/setup.cfg +4 -0
- neurogen-0.1.0/src/neurogen/__init__.py +28 -0
- neurogen-0.1.0/src/neurogen/__main__.py +6 -0
- neurogen-0.1.0/src/neurogen/api.py +112 -0
- neurogen-0.1.0/src/neurogen/apps/__init__.py +17 -0
- neurogen-0.1.0/src/neurogen/apps/cache.py +222 -0
- neurogen-0.1.0/src/neurogen/apps/deploy.py +320 -0
- neurogen-0.1.0/src/neurogen/apps/describe.py +128 -0
- neurogen-0.1.0/src/neurogen/apps/engineer.py +167 -0
- neurogen-0.1.0/src/neurogen/apps/eval.py +134 -0
- neurogen-0.1.0/src/neurogen/apps/init.py +387 -0
- neurogen-0.1.0/src/neurogen/apps/preprocess.py +335 -0
- neurogen-0.1.0/src/neurogen/apps/preprocess_ops.py +378 -0
- neurogen-0.1.0/src/neurogen/apps/source_args.py +106 -0
- neurogen-0.1.0/src/neurogen/apps/train.py +284 -0
- neurogen-0.1.0/src/neurogen/apps/tune.py +413 -0
- neurogen-0.1.0/src/neurogen/builders/__init__.py +13 -0
- neurogen-0.1.0/src/neurogen/builders/build_progress_bars.py +60 -0
- neurogen-0.1.0/src/neurogen/cli.py +77 -0
- neurogen-0.1.0/src/neurogen/config/__init__.py +46 -0
- neurogen-0.1.0/src/neurogen/config/credentials.py +112 -0
- neurogen-0.1.0/src/neurogen/config/env.py +205 -0
- neurogen-0.1.0/src/neurogen/config/experiment.py +41 -0
- neurogen-0.1.0/src/neurogen/config/experiment_configs/__init__.py +15 -0
- neurogen-0.1.0/src/neurogen/config/experiment_configs/rhae.py +130 -0
- neurogen-0.1.0/src/neurogen/config/experiment_configs/rhae_gen_base.py +130 -0
- neurogen-0.1.0/src/neurogen/config/experiment_configs/rhlm.py +131 -0
- neurogen-0.1.0/src/neurogen/config/loader.py +490 -0
- neurogen-0.1.0/src/neurogen/config/logging.py +2 -0
- neurogen-0.1.0/src/neurogen/config/numerics.py +172 -0
- neurogen-0.1.0/src/neurogen/config/override.py +70 -0
- neurogen-0.1.0/src/neurogen/config/runtime.py +26 -0
- neurogen-0.1.0/src/neurogen/config/tune.py +21 -0
- neurogen-0.1.0/src/neurogen/config/tune_spec.py +183 -0
- neurogen-0.1.0/src/neurogen/data/__init__.py +28 -0
- neurogen-0.1.0/src/neurogen/data/datasets/__init__.py +7 -0
- neurogen-0.1.0/src/neurogen/data/datasets/ipc_cache.py +351 -0
- neurogen-0.1.0/src/neurogen/data/datasets/presence.py +24 -0
- neurogen-0.1.0/src/neurogen/data/datasets/tensor_extract.py +68 -0
- neurogen-0.1.0/src/neurogen/data/datasets/text_sequence_dataset.py +436 -0
- neurogen-0.1.0/src/neurogen/data/datasets/truncation.py +116 -0
- neurogen-0.1.0/src/neurogen/data/datasets/types.py +139 -0
- neurogen-0.1.0/src/neurogen/data/formaters/__init__.py +9 -0
- neurogen-0.1.0/src/neurogen/data/formaters/base.py +15 -0
- neurogen-0.1.0/src/neurogen/data/formaters/citation_graph.py +112 -0
- neurogen-0.1.0/src/neurogen/data/formaters/graph.py +99 -0
- neurogen-0.1.0/src/neurogen/data/pipeline/__init__.py +1 -0
- neurogen-0.1.0/src/neurogen/data/pipeline/describe.py +192 -0
- neurogen-0.1.0/src/neurogen/data/pipeline/engineer.py +220 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/__init__.py +59 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/clean.py +218 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/embed.py +150 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/embed_dtype.py +24 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/embed_huggingface.py +159 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/embed_modal.py +69 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/embed_registry.py +54 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/model_ref.py +112 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/models.py +267 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/pipeline.py +378 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/steps.py +148 -0
- neurogen-0.1.0/src/neurogen/data/preprocess/tokenise.py +68 -0
- neurogen-0.1.0/src/neurogen/data/samplers/__init__.py +9 -0
- neurogen-0.1.0/src/neurogen/data/samplers/auto_binned_sampler.py +63 -0
- neurogen-0.1.0/src/neurogen/data/samplers/portion_sampler.py +16 -0
- neurogen-0.1.0/src/neurogen/data/samplers/stratified_class_sampler.py +53 -0
- neurogen-0.1.0/src/neurogen/data/sources/__init__.py +37 -0
- neurogen-0.1.0/src/neurogen/data/sources/base.py +28 -0
- neurogen-0.1.0/src/neurogen/data/sources/local.py +40 -0
- neurogen-0.1.0/src/neurogen/data/sources/modal.py +36 -0
- neurogen-0.1.0/src/neurogen/data/sources/registry.py +32 -0
- neurogen-0.1.0/src/neurogen/data/tokenisers/__init__.py +135 -0
- neurogen-0.1.0/src/neurogen/data/tokenisers/cache.py +91 -0
- neurogen-0.1.0/src/neurogen/data/tokenisers/ref.py +129 -0
- neurogen-0.1.0/src/neurogen/data/tokenisers/single_byte_level.py +83 -0
- neurogen-0.1.0/src/neurogen/experiments/__init__.py +0 -0
- neurogen-0.1.0/src/neurogen/experiments/rhae.py +142 -0
- neurogen-0.1.0/src/neurogen/experiments/rhae_gen_base.py +146 -0
- neurogen-0.1.0/src/neurogen/experiments/rhlm.py +135 -0
- neurogen-0.1.0/src/neurogen/models/__init__.py +15 -0
- neurogen-0.1.0/src/neurogen/models/protocols.py +25 -0
- neurogen-0.1.0/src/neurogen/models/rhae.py +736 -0
- neurogen-0.1.0/src/neurogen/models/rhae_gen_base.py +926 -0
- neurogen-0.1.0/src/neurogen/models/rhlm.py +802 -0
- neurogen-0.1.0/src/neurogen/models/rhlm_class.py +752 -0
- neurogen-0.1.0/src/neurogen/models/rhlm_shape.py +93 -0
- neurogen-0.1.0/src/neurogen/models/rhlm_tokenizer.py +88 -0
- neurogen-0.1.0/src/neurogen/models/transformer_class.py +244 -0
- neurogen-0.1.0/src/neurogen/models/transformer_var_reg.py +236 -0
- neurogen-0.1.0/src/neurogen/project.py +188 -0
- neurogen-0.1.0/src/neurogen/py.typed +0 -0
- neurogen-0.1.0/src/neurogen/runtime/__init__.py +8 -0
- neurogen-0.1.0/src/neurogen/runtime/base.py +67 -0
- neurogen-0.1.0/src/neurogen/runtime/factory.py +43 -0
- neurogen-0.1.0/src/neurogen/runtime/local.py +129 -0
- neurogen-0.1.0/src/neurogen/runtime/mlflow_auth.py +111 -0
- neurogen-0.1.0/src/neurogen/runtime/mlflow_cf_access.py +61 -0
- neurogen-0.1.0/src/neurogen/runtime/modal_env.py +155 -0
- neurogen-0.1.0/src/neurogen/runtime/modal_runtime.py +719 -0
- neurogen-0.1.0/src/neurogen/runtime/run_lifecycle.py +55 -0
- neurogen-0.1.0/src/neurogen/training/__init__.py +7 -0
- neurogen-0.1.0/src/neurogen/training/callbacks/__init__.py +25 -0
- neurogen-0.1.0/src/neurogen/training/callbacks/early_stop.py +1210 -0
- neurogen-0.1.0/src/neurogen/training/checkpointing/__init__.py +15 -0
- neurogen-0.1.0/src/neurogen/training/checkpointing/base.py +41 -0
- neurogen-0.1.0/src/neurogen/training/checkpointing/local.py +63 -0
- neurogen-0.1.0/src/neurogen/training/checkpointing/mlflow_local.py +113 -0
- neurogen-0.1.0/src/neurogen/training/checkpointing/mlflow_store.py +127 -0
- neurogen-0.1.0/src/neurogen/training/checkpointing/s3.py +33 -0
- neurogen-0.1.0/src/neurogen/training/diagnostics/__init__.py +17 -0
- neurogen-0.1.0/src/neurogen/training/diagnostics/nan_inspector.py +605 -0
- neurogen-0.1.0/src/neurogen/training/engine.py +300 -0
- neurogen-0.1.0/src/neurogen/training/losses/MAE.py +31 -0
- neurogen-0.1.0/src/neurogen/training/losses/MAE_var.py +23 -0
- neurogen-0.1.0/src/neurogen/training/losses/__init__.py +25 -0
- neurogen-0.1.0/src/neurogen/training/losses/binary_cross_entropy.py +36 -0
- neurogen-0.1.0/src/neurogen/training/losses/cross_entropy.py +48 -0
- neurogen-0.1.0/src/neurogen/training/losses/entropy.py +12 -0
- neurogen-0.1.0/src/neurogen/training/losses/loss_protocol.py +12 -0
- neurogen-0.1.0/src/neurogen/training/losses/wasserstein_cross_entropy.py +62 -0
- neurogen-0.1.0/src/neurogen/training/losses/wasserstein_entropy.py +59 -0
- neurogen-0.1.0/src/neurogen/training/losses/wasserstein_funcs.py +35 -0
- neurogen-0.1.0/src/neurogen/training/losses/wasserstein_loss.py +34 -0
- neurogen-0.1.0/src/neurogen/training/losses/wasserstein_sigma.py +58 -0
- neurogen-0.1.0/src/neurogen/training/optimizers/__init__.py +11 -0
- neurogen-0.1.0/src/neurogen/training/optimizers/adam_w.py +7 -0
- neurogen-0.1.0/src/neurogen/training/optimizers/specs.py +25 -0
- neurogen-0.1.0/src/neurogen/training/pipeline/__init__.py +23 -0
- neurogen-0.1.0/src/neurogen/training/pipeline/_common.py +91 -0
- neurogen-0.1.0/src/neurogen/training/pipeline/eval.py +423 -0
- neurogen-0.1.0/src/neurogen/training/pipeline/train.py +551 -0
- neurogen-0.1.0/src/neurogen/training/schedulers.py +120 -0
- neurogen-0.1.0/src/neurogen/training/strategies/__init__.py +17 -0
- neurogen-0.1.0/src/neurogen/training/strategies/base.py +295 -0
- neurogen-0.1.0/src/neurogen/training/strategies/classification.py +135 -0
- neurogen-0.1.0/src/neurogen/training/strategies/inner_diffusion_text_sequence.py +168 -0
- neurogen-0.1.0/src/neurogen/training/strategies/text_sequence.py +317 -0
- neurogen-0.1.0/src/neurogen/training/tracking/__init__.py +42 -0
- neurogen-0.1.0/src/neurogen/training/tracking/base.py +10 -0
- neurogen-0.1.0/src/neurogen/training/tracking/best_metrics.py +165 -0
- neurogen-0.1.0/src/neurogen/training/tracking/binary_classification_tracker.py +412 -0
- neurogen-0.1.0/src/neurogen/training/tracking/calc_metrics.py +18 -0
- neurogen-0.1.0/src/neurogen/training/tracking/classification_tracker.py +234 -0
- neurogen-0.1.0/src/neurogen/training/tracking/heteroscadastic_regression_tracker.py +282 -0
- neurogen-0.1.0/src/neurogen/training/tracking/log_lrs.py +14 -0
- neurogen-0.1.0/src/neurogen/training/tracking/metric_tracker.py +329 -0
- neurogen-0.1.0/src/neurogen/training/tracking/ordinal_regression_tracker.py +333 -0
- neurogen-0.1.0/src/neurogen/training/tracking/param_keys.py +61 -0
- neurogen-0.1.0/src/neurogen/training/tracking/params.py +254 -0
- neurogen-0.1.0/src/neurogen/training/tracking/plot_funcs.py +30 -0
- neurogen-0.1.0/src/neurogen/training/tracking/regression_tracker.py +212 -0
- neurogen-0.1.0/src/neurogen/training/tracking/text_autoencoder_tracker.py +159 -0
- neurogen-0.1.0/src/neurogen/training/tracking/text_metrics_worker.py +305 -0
- neurogen-0.1.0/src/neurogen/training/tracking/text_showcase.py +477 -0
- neurogen-0.1.0/src/neurogen/utils/__init__.py +34 -0
- neurogen-0.1.0/src/neurogen/utils/build_helper.py +107 -0
- neurogen-0.1.0/src/neurogen/utils/export_parquet.py +40 -0
- neurogen-0.1.0/src/neurogen/utils/import_all_local.py +13 -0
- neurogen-0.1.0/src/neurogen/utils/logging.py +45 -0
- neurogen-0.1.0/src/neurogen/utils/param_count.py +199 -0
- neurogen-0.1.0/src/neurogen/utils/plusN_iterator.py +13 -0
- neurogen-0.1.0/src/neurogen/utils/registry.py +44 -0
- neurogen-0.1.0/src/neurogen.egg-info/PKG-INFO +222 -0
- neurogen-0.1.0/src/neurogen.egg-info/SOURCES.txt +248 -0
- neurogen-0.1.0/src/neurogen.egg-info/dependency_links.txt +1 -0
- neurogen-0.1.0/src/neurogen.egg-info/entry_points.txt +2 -0
- neurogen-0.1.0/src/neurogen.egg-info/requires.txt +22 -0
- neurogen-0.1.0/src/neurogen.egg-info/top_level.txt +1 -0
- neurogen-0.1.0/tests/test_best_metrics.py +344 -0
- neurogen-0.1.0/tests/test_cache_app.py +198 -0
- neurogen-0.1.0/tests/test_clean.py +191 -0
- neurogen-0.1.0/tests/test_cli_import_weight.py +197 -0
- neurogen-0.1.0/tests/test_config_loader.py +289 -0
- neurogen-0.1.0/tests/test_config_override.py +220 -0
- neurogen-0.1.0/tests/test_data_sources.py +48 -0
- neurogen-0.1.0/tests/test_dataset_presence.py +57 -0
- neurogen-0.1.0/tests/test_deploy_app.py +433 -0
- neurogen-0.1.0/tests/test_describe_pipeline.py +184 -0
- neurogen-0.1.0/tests/test_early_stop.py +2329 -0
- neurogen-0.1.0/tests/test_embed_dtype.py +40 -0
- neurogen-0.1.0/tests/test_engine_early_stop.py +185 -0
- neurogen-0.1.0/tests/test_env_source.py +57 -0
- neurogen-0.1.0/tests/test_experiment_config_files.py +76 -0
- neurogen-0.1.0/tests/test_experiment_resolution.py +198 -0
- neurogen-0.1.0/tests/test_headless_engine.py +53 -0
- neurogen-0.1.0/tests/test_id_feed.py +141 -0
- neurogen-0.1.0/tests/test_init.py +172 -0
- neurogen-0.1.0/tests/test_ipc_cache_logging.py +228 -0
- neurogen-0.1.0/tests/test_ipc_cache_manifest.py +105 -0
- neurogen-0.1.0/tests/test_metric_tracker.py +69 -0
- neurogen-0.1.0/tests/test_mlflow_auth.py +259 -0
- neurogen-0.1.0/tests/test_modal_config.py +168 -0
- neurogen-0.1.0/tests/test_modal_dispatch.py +276 -0
- neurogen-0.1.0/tests/test_modal_env.py +129 -0
- neurogen-0.1.0/tests/test_modal_image.py +167 -0
- neurogen-0.1.0/tests/test_modal_runtime_secrets.py +132 -0
- neurogen-0.1.0/tests/test_modal_sdk_contract.py +77 -0
- neurogen-0.1.0/tests/test_model_batch_conformance.py +88 -0
- neurogen-0.1.0/tests/test_model_ref.py +153 -0
- neurogen-0.1.0/tests/test_model_registry_config.py +238 -0
- neurogen-0.1.0/tests/test_model_store.py +188 -0
- neurogen-0.1.0/tests/test_nan_guard.py +246 -0
- neurogen-0.1.0/tests/test_nan_inspector.py +362 -0
- neurogen-0.1.0/tests/test_numerics_config.py +171 -0
- neurogen-0.1.0/tests/test_package.py +128 -0
- neurogen-0.1.0/tests/test_param_count.py +90 -0
- neurogen-0.1.0/tests/test_param_keys.py +95 -0
- neurogen-0.1.0/tests/test_param_walker.py +343 -0
- neurogen-0.1.0/tests/test_pipeline_early_stop.py +92 -0
- neurogen-0.1.0/tests/test_pipeline_jobs.py +221 -0
- neurogen-0.1.0/tests/test_preprocess_byte_encoding.py +118 -0
- neurogen-0.1.0/tests/test_preprocess_cli.py +152 -0
- neurogen-0.1.0/tests/test_preprocess_cli_parser.py +314 -0
- neurogen-0.1.0/tests/test_preprocess_e2e.py +215 -0
- neurogen-0.1.0/tests/test_preprocess_job.py +511 -0
- neurogen-0.1.0/tests/test_project.py +185 -0
- neurogen-0.1.0/tests/test_project_cli.py +297 -0
- neurogen-0.1.0/tests/test_release_guard.py +312 -0
- neurogen-0.1.0/tests/test_release_workflows.py +109 -0
- neurogen-0.1.0/tests/test_rhlm_shape.py +85 -0
- neurogen-0.1.0/tests/test_rhlm_tokenizer.py +83 -0
- neurogen-0.1.0/tests/test_runtime_dispatch.py +113 -0
- neurogen-0.1.0/tests/test_runtime_source_compat.py +9 -0
- neurogen-0.1.0/tests/test_selected_output_embedder.py +144 -0
- neurogen-0.1.0/tests/test_single_byte_level_tokenizer.py +204 -0
- neurogen-0.1.0/tests/test_source_args.py +89 -0
- neurogen-0.1.0/tests/test_steps.py +137 -0
- neurogen-0.1.0/tests/test_store_latch.py +83 -0
- neurogen-0.1.0/tests/test_strategy_numerics_context.py +62 -0
- neurogen-0.1.0/tests/test_stream_sync.py +92 -0
- neurogen-0.1.0/tests/test_tensor_extract.py +55 -0
- neurogen-0.1.0/tests/test_text_autoencoder_tracker.py +212 -0
- neurogen-0.1.0/tests/test_text_metrics_worker.py +254 -0
- neurogen-0.1.0/tests/test_text_sequence_metrics.py +245 -0
- neurogen-0.1.0/tests/test_text_sequence_special_tokens.py +187 -0
- neurogen-0.1.0/tests/test_text_sequence_target.py +94 -0
- neurogen-0.1.0/tests/test_text_showcase.py +683 -0
- neurogen-0.1.0/tests/test_tokeniser_cache.py +123 -0
- neurogen-0.1.0/tests/test_tokeniser_ref.py +73 -0
- neurogen-0.1.0/tests/test_tracker_arity.py +118 -0
- neurogen-0.1.0/tests/test_tracker_exception_logging.py +101 -0
- neurogen-0.1.0/tests/test_train_cli.py +49 -0
- neurogen-0.1.0/tests/test_train_params.py +432 -0
- neurogen-0.1.0/tests/test_truncation.py +85 -0
- neurogen-0.1.0/tests/test_tune_app.py +493 -0
- neurogen-0.1.0/tests/test_tune_spec.py +186 -0
- neurogen-0.1.0/tests/test_wheel_contents.py +226 -0
neurogen-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Neurogenesis Ltd.
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
neurogen-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: neurogen
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CLI driven pytorch framework with local/modal execution
|
|
5
|
+
Author-email: Felix Noble <felix.noble@ngenesis.co.uk>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: <3.14,>=3.12
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: polars==1.38.1
|
|
13
|
+
Requires-Dist: python-dotenv==1.2.3
|
|
14
|
+
Requires-Dist: pandas==2.3.3
|
|
15
|
+
Requires-Dist: mlflow==3.18.0
|
|
16
|
+
Requires-Dist: transformers==4.48.0
|
|
17
|
+
Requires-Dist: scikit-learn==1.8.0
|
|
18
|
+
Requires-Dist: typer==0.23.1
|
|
19
|
+
Requires-Dist: seaborn==0.13.2
|
|
20
|
+
Requires-Dist: sacrebleu==2.5.0
|
|
21
|
+
Requires-Dist: rouge_score==0.1.2
|
|
22
|
+
Provides-Extra: modal
|
|
23
|
+
Requires-Dist: modal>=0.73.0; extra == "modal"
|
|
24
|
+
Provides-Extra: cpu
|
|
25
|
+
Requires-Dist: torch>=2.14; extra == "cpu"
|
|
26
|
+
Provides-Extra: cuda126
|
|
27
|
+
Requires-Dist: torch>=2.14; extra == "cuda126"
|
|
28
|
+
Provides-Extra: cuda130
|
|
29
|
+
Requires-Dist: torch>=2.14; extra == "cuda130"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# neurogen
|
|
33
|
+
|
|
34
|
+
`neurogen` is a CLI-based machine learning framework for forecasting outcomes
|
|
35
|
+
from text corpora over time. It began life as a citation-impact predictor, but
|
|
36
|
+
nothing in the pipeline is specific to academic papers: embed a text dataset,
|
|
37
|
+
track it across time windows, train, and evaluate.
|
|
38
|
+
|
|
39
|
+
The core training loop and data pre-processing are driven entirely by the CLI
|
|
40
|
+
and integrate with MLflow to track experiments. Each experiment is a single
|
|
41
|
+
self-contained Python module that instantiates its own models, datasets,
|
|
42
|
+
samplers, DataLoaders, strategy, tracker, and checkpoint processor, and every
|
|
43
|
+
app runs either locally or on Modal GPUs with one `--runtime` flag.
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
`neurogen` installs as one top-level package with a `neurogen` console script.
|
|
48
|
+
PyTorch is not a core dependency; it arrives through one of the mutually
|
|
49
|
+
exclusive `cpu`, `cuda126`, or `cuda130` extras.
|
|
50
|
+
|
|
51
|
+
```console
|
|
52
|
+
pip install neurogen # CLI only; no torch
|
|
53
|
+
pip install "neurogen[cpu]" # CPU PyTorch
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`pip` ignores `[tool.uv.sources]`, so select the PyTorch build with its index
|
|
57
|
+
explicitly:
|
|
58
|
+
|
|
59
|
+
```console
|
|
60
|
+
# CPU
|
|
61
|
+
pip install torch --index-url https://download.pytorch.org/whl/cpu
|
|
62
|
+
pip install "neurogen[cpu]"
|
|
63
|
+
|
|
64
|
+
# CUDA 12.6 (use cuda130 and the whl/cu130 index for CUDA 13.0)
|
|
65
|
+
pip install torch --index-url https://download.pytorch.org/whl/cu126
|
|
66
|
+
pip install "neurogen[cuda126]"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
With [uv](https://docs.astral.sh/uv/), the extras resolve the matching index
|
|
70
|
+
for you:
|
|
71
|
+
|
|
72
|
+
```console
|
|
73
|
+
uv add "neurogen[cpu]" # or [cuda126] / [cuda130]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Python 3.12 and 3.13 are supported (`requires-python = ">=3.12,<3.14"`).
|
|
77
|
+
|
|
78
|
+
## Quick start
|
|
79
|
+
|
|
80
|
+
Create a project, then train its generated example for one local step:
|
|
81
|
+
|
|
82
|
+
```console
|
|
83
|
+
neurogen init demo
|
|
84
|
+
cd demo
|
|
85
|
+
neurogen train -e example --name demo --no-gpu
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`neurogen init [NAME]` writes a real importable package and refuses to
|
|
89
|
+
overwrite existing files unless `--force` is passed. It runs no `git init` and
|
|
90
|
+
no `pip install`. The generated layout is:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
demo/
|
|
94
|
+
├── neurogen.toml # project marker and manifest
|
|
95
|
+
├── pyproject.toml # project name, dependencies, [tool.neurogen]
|
|
96
|
+
├── config.toml # [env], [source], and [runtime] defaults
|
|
97
|
+
├── .gitignore
|
|
98
|
+
├── README.md
|
|
99
|
+
└── demo/
|
|
100
|
+
├── __init__.py
|
|
101
|
+
├── experiments/example.py # the importable example experiment
|
|
102
|
+
├── models/tiny.py
|
|
103
|
+
├── datasets/tiny.py
|
|
104
|
+
├── strategies/__init__.py
|
|
105
|
+
└── tokenisers/__init__.py
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Local runs and direct imports
|
|
109
|
+
|
|
110
|
+
A project declares itself with a `neurogen.toml` marker or a `[tool.neurogen]`
|
|
111
|
+
table in `pyproject.toml`. The CLI walks up from the working directory to find
|
|
112
|
+
one, prepends the project root to `sys.path`, and imports the experiment
|
|
113
|
+
directly as `<package>.experiments.<name>`. There is no plugin registry and no
|
|
114
|
+
editable install: drop a module under `demo/models/` and import it from an
|
|
115
|
+
experiment module.
|
|
116
|
+
|
|
117
|
+
`--project PATH` overrides discovery. `-e`/`--experiment` accepts four forms:
|
|
118
|
+
|
|
119
|
+
| Input | Resolution |
|
|
120
|
+
|---|---|
|
|
121
|
+
| `name` | `<project package>.experiments.name` |
|
|
122
|
+
| `pkg.mod.name` | that dotted module |
|
|
123
|
+
| `neurogen:name` | a builtin experiment in `neurogen.experiments` |
|
|
124
|
+
| `path/to/file.py` | load from the file path |
|
|
125
|
+
|
|
126
|
+
Builtin experiments run with no project at all:
|
|
127
|
+
|
|
128
|
+
```console
|
|
129
|
+
neurogen -e neurogen:rhlm train -s smoke --no-gpu
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Dependencies declared in the project `pyproject.toml` are yours to install;
|
|
133
|
+
third-party packages already in the environment are importable because the CLI
|
|
134
|
+
runs in that environment.
|
|
135
|
+
|
|
136
|
+
## Machine settings
|
|
137
|
+
|
|
138
|
+
Machine settings (`[env]`, `[source]`, `[runtime]`, `[models]`) are read from
|
|
139
|
+
`config.toml` at the **project root** — the directory holding the
|
|
140
|
+
`neurogen.toml` marker or the `[tool.neurogen]` table. A project that predates
|
|
141
|
+
the 0.1 layout may keep the file at `config/config.toml` instead. With no
|
|
142
|
+
project marker, discovery finds nothing and the library defaults apply
|
|
143
|
+
(`sqlite:///mlflow.db` for tracking, `/tmp/artifacts` for artifacts, no
|
|
144
|
+
`[runtime.modal]` section), so a Modal run needs a project. `config/config.example.toml`
|
|
145
|
+
in this repository is the reference for the accepted keys; copy it to
|
|
146
|
+
`<project>/config.toml` and edit it there.
|
|
147
|
+
|
|
148
|
+
## Builtins
|
|
149
|
+
|
|
150
|
+
Builtin models, datasets, strategies, tokenisers, losses, and experiments ship
|
|
151
|
+
with the package and resolve from it. `neurogen init` copies a minimal example
|
|
152
|
+
into the project for editing; the builtin set itself does not change in 0.1.
|
|
153
|
+
|
|
154
|
+
## Deploy to Modal
|
|
155
|
+
|
|
156
|
+
`neurogen deploy` builds a builtin-only Modal image from a locally built
|
|
157
|
+
`neurogen` wheel and shells out to the Modal CLI. Install the optional extra
|
|
158
|
+
and authenticate once:
|
|
159
|
+
|
|
160
|
+
```console
|
|
161
|
+
pip install "neurogen[modal]" # or: uv add "neurogen[modal]"
|
|
162
|
+
modal token new
|
|
163
|
+
neurogen deploy
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Preprocess, describe, and engineer dispatch to the deployed app by name; train
|
|
167
|
+
and eval spawn ephemeral jobs. Train jobs are spawned fire-and-forget: the CLI
|
|
168
|
+
prints the MLflow run id and Modal FunctionCall id and returns immediately.
|
|
169
|
+
Block until done with `modal FunctionCall.from_id(<id>).get()`, or watch the run
|
|
170
|
+
in the MLflow UI.
|
|
171
|
+
|
|
172
|
+
The image carries the builtin framework and pinned torch only. Packaging a
|
|
173
|
+
**user project** into the image is not part of 0.1; that is the subject of the
|
|
174
|
+
[0.2 proposal](plans/releases/0.2.md). A project experiment still runs locally
|
|
175
|
+
(`--runtime local`). Re-deploy after changing `neurogen` itself; a project code
|
|
176
|
+
change does not reach the builtin image. `--wheel PATH` installs a prebuilt
|
|
177
|
+
`neurogen` wheel instead of building one from the checkout.
|
|
178
|
+
|
|
179
|
+
## Repository layout
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
neurogen/
|
|
183
|
+
├── pyproject.toml
|
|
184
|
+
├── config/
|
|
185
|
+
│ └── config.example.toml # example machine settings
|
|
186
|
+
├── src/
|
|
187
|
+
│ └── neurogen/
|
|
188
|
+
│ ├── cli.py # root Typer app
|
|
189
|
+
│ ├── api.py # public protocol hub
|
|
190
|
+
│ ├── __init__.py # lazy __getattr__, __version__
|
|
191
|
+
│ ├── __main__.py # python -m neurogen
|
|
192
|
+
│ ├── apps/ # Typer CLI apps (train, eval, preprocess, ...)
|
|
193
|
+
│ ├── builders/
|
|
194
|
+
│ ├── config/ # schemas, loader, env/runtime config
|
|
195
|
+
│ ├── data/ # sources, pipelines, datasets, samplers
|
|
196
|
+
│ ├── experiments/ # builtin experiments (neurogen:<name>)
|
|
197
|
+
│ ├── models/
|
|
198
|
+
│ ├── runtime/ # local and Modal backends
|
|
199
|
+
│ ├── training/ # engine, strategies, losses, tracking
|
|
200
|
+
│ └── utils/
|
|
201
|
+
├── plans/
|
|
202
|
+
│ ├── legacy/ # archived pre-0.1 plans
|
|
203
|
+
│ └── releases/ # 0.1.md (this release), 0.2.md, and 0.3.md
|
|
204
|
+
└── tests/
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Tech stack
|
|
208
|
+
|
|
209
|
+
- **Core.** Python 3.12-3.13 and PyTorch.
|
|
210
|
+
- **MLOps.** MLflow for tracking, Modal for GPUs, scikit-learn for metrics.
|
|
211
|
+
- **Data.** Polars for predicate-pushdown loading and multi-worker serving.
|
|
212
|
+
- **Validation.** Pydantic for typed config schemas.
|
|
213
|
+
- **Tooling.** Typer for the CLI and Rich for logging.
|
|
214
|
+
|
|
215
|
+
## Documentation
|
|
216
|
+
|
|
217
|
+
- [ROADMAP.md](ROADMAP.md) — the post-0.1 line.
|
|
218
|
+
- [CHANGELOG.md](CHANGELOG.md) — releases, starting at 0.1.0.
|
|
219
|
+
- [docs/](docs/index.md) — apps, experiments, data pipeline, and training
|
|
220
|
+
internals.
|
|
221
|
+
- [plans/releases/0.1.md](plans/releases/0.1.md) — this release's plan.
|
|
222
|
+
- [docs/legacy-changelog.md](docs/legacy-changelog.md) — pre-0.1 history.
|
neurogen-0.1.0/README.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# neurogen
|
|
2
|
+
|
|
3
|
+
`neurogen` is a CLI-based machine learning framework for forecasting outcomes
|
|
4
|
+
from text corpora over time. It began life as a citation-impact predictor, but
|
|
5
|
+
nothing in the pipeline is specific to academic papers: embed a text dataset,
|
|
6
|
+
track it across time windows, train, and evaluate.
|
|
7
|
+
|
|
8
|
+
The core training loop and data pre-processing are driven entirely by the CLI
|
|
9
|
+
and integrate with MLflow to track experiments. Each experiment is a single
|
|
10
|
+
self-contained Python module that instantiates its own models, datasets,
|
|
11
|
+
samplers, DataLoaders, strategy, tracker, and checkpoint processor, and every
|
|
12
|
+
app runs either locally or on Modal GPUs with one `--runtime` flag.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
`neurogen` installs as one top-level package with a `neurogen` console script.
|
|
17
|
+
PyTorch is not a core dependency; it arrives through one of the mutually
|
|
18
|
+
exclusive `cpu`, `cuda126`, or `cuda130` extras.
|
|
19
|
+
|
|
20
|
+
```console
|
|
21
|
+
pip install neurogen # CLI only; no torch
|
|
22
|
+
pip install "neurogen[cpu]" # CPU PyTorch
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`pip` ignores `[tool.uv.sources]`, so select the PyTorch build with its index
|
|
26
|
+
explicitly:
|
|
27
|
+
|
|
28
|
+
```console
|
|
29
|
+
# CPU
|
|
30
|
+
pip install torch --index-url https://download.pytorch.org/whl/cpu
|
|
31
|
+
pip install "neurogen[cpu]"
|
|
32
|
+
|
|
33
|
+
# CUDA 12.6 (use cuda130 and the whl/cu130 index for CUDA 13.0)
|
|
34
|
+
pip install torch --index-url https://download.pytorch.org/whl/cu126
|
|
35
|
+
pip install "neurogen[cuda126]"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
With [uv](https://docs.astral.sh/uv/), the extras resolve the matching index
|
|
39
|
+
for you:
|
|
40
|
+
|
|
41
|
+
```console
|
|
42
|
+
uv add "neurogen[cpu]" # or [cuda126] / [cuda130]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Python 3.12 and 3.13 are supported (`requires-python = ">=3.12,<3.14"`).
|
|
46
|
+
|
|
47
|
+
## Quick start
|
|
48
|
+
|
|
49
|
+
Create a project, then train its generated example for one local step:
|
|
50
|
+
|
|
51
|
+
```console
|
|
52
|
+
neurogen init demo
|
|
53
|
+
cd demo
|
|
54
|
+
neurogen train -e example --name demo --no-gpu
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`neurogen init [NAME]` writes a real importable package and refuses to
|
|
58
|
+
overwrite existing files unless `--force` is passed. It runs no `git init` and
|
|
59
|
+
no `pip install`. The generated layout is:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
demo/
|
|
63
|
+
├── neurogen.toml # project marker and manifest
|
|
64
|
+
├── pyproject.toml # project name, dependencies, [tool.neurogen]
|
|
65
|
+
├── config.toml # [env], [source], and [runtime] defaults
|
|
66
|
+
├── .gitignore
|
|
67
|
+
├── README.md
|
|
68
|
+
└── demo/
|
|
69
|
+
├── __init__.py
|
|
70
|
+
├── experiments/example.py # the importable example experiment
|
|
71
|
+
├── models/tiny.py
|
|
72
|
+
├── datasets/tiny.py
|
|
73
|
+
├── strategies/__init__.py
|
|
74
|
+
└── tokenisers/__init__.py
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Local runs and direct imports
|
|
78
|
+
|
|
79
|
+
A project declares itself with a `neurogen.toml` marker or a `[tool.neurogen]`
|
|
80
|
+
table in `pyproject.toml`. The CLI walks up from the working directory to find
|
|
81
|
+
one, prepends the project root to `sys.path`, and imports the experiment
|
|
82
|
+
directly as `<package>.experiments.<name>`. There is no plugin registry and no
|
|
83
|
+
editable install: drop a module under `demo/models/` and import it from an
|
|
84
|
+
experiment module.
|
|
85
|
+
|
|
86
|
+
`--project PATH` overrides discovery. `-e`/`--experiment` accepts four forms:
|
|
87
|
+
|
|
88
|
+
| Input | Resolution |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `name` | `<project package>.experiments.name` |
|
|
91
|
+
| `pkg.mod.name` | that dotted module |
|
|
92
|
+
| `neurogen:name` | a builtin experiment in `neurogen.experiments` |
|
|
93
|
+
| `path/to/file.py` | load from the file path |
|
|
94
|
+
|
|
95
|
+
Builtin experiments run with no project at all:
|
|
96
|
+
|
|
97
|
+
```console
|
|
98
|
+
neurogen -e neurogen:rhlm train -s smoke --no-gpu
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Dependencies declared in the project `pyproject.toml` are yours to install;
|
|
102
|
+
third-party packages already in the environment are importable because the CLI
|
|
103
|
+
runs in that environment.
|
|
104
|
+
|
|
105
|
+
## Machine settings
|
|
106
|
+
|
|
107
|
+
Machine settings (`[env]`, `[source]`, `[runtime]`, `[models]`) are read from
|
|
108
|
+
`config.toml` at the **project root** — the directory holding the
|
|
109
|
+
`neurogen.toml` marker or the `[tool.neurogen]` table. A project that predates
|
|
110
|
+
the 0.1 layout may keep the file at `config/config.toml` instead. With no
|
|
111
|
+
project marker, discovery finds nothing and the library defaults apply
|
|
112
|
+
(`sqlite:///mlflow.db` for tracking, `/tmp/artifacts` for artifacts, no
|
|
113
|
+
`[runtime.modal]` section), so a Modal run needs a project. `config/config.example.toml`
|
|
114
|
+
in this repository is the reference for the accepted keys; copy it to
|
|
115
|
+
`<project>/config.toml` and edit it there.
|
|
116
|
+
|
|
117
|
+
## Builtins
|
|
118
|
+
|
|
119
|
+
Builtin models, datasets, strategies, tokenisers, losses, and experiments ship
|
|
120
|
+
with the package and resolve from it. `neurogen init` copies a minimal example
|
|
121
|
+
into the project for editing; the builtin set itself does not change in 0.1.
|
|
122
|
+
|
|
123
|
+
## Deploy to Modal
|
|
124
|
+
|
|
125
|
+
`neurogen deploy` builds a builtin-only Modal image from a locally built
|
|
126
|
+
`neurogen` wheel and shells out to the Modal CLI. Install the optional extra
|
|
127
|
+
and authenticate once:
|
|
128
|
+
|
|
129
|
+
```console
|
|
130
|
+
pip install "neurogen[modal]" # or: uv add "neurogen[modal]"
|
|
131
|
+
modal token new
|
|
132
|
+
neurogen deploy
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Preprocess, describe, and engineer dispatch to the deployed app by name; train
|
|
136
|
+
and eval spawn ephemeral jobs. Train jobs are spawned fire-and-forget: the CLI
|
|
137
|
+
prints the MLflow run id and Modal FunctionCall id and returns immediately.
|
|
138
|
+
Block until done with `modal FunctionCall.from_id(<id>).get()`, or watch the run
|
|
139
|
+
in the MLflow UI.
|
|
140
|
+
|
|
141
|
+
The image carries the builtin framework and pinned torch only. Packaging a
|
|
142
|
+
**user project** into the image is not part of 0.1; that is the subject of the
|
|
143
|
+
[0.2 proposal](plans/releases/0.2.md). A project experiment still runs locally
|
|
144
|
+
(`--runtime local`). Re-deploy after changing `neurogen` itself; a project code
|
|
145
|
+
change does not reach the builtin image. `--wheel PATH` installs a prebuilt
|
|
146
|
+
`neurogen` wheel instead of building one from the checkout.
|
|
147
|
+
|
|
148
|
+
## Repository layout
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
neurogen/
|
|
152
|
+
├── pyproject.toml
|
|
153
|
+
├── config/
|
|
154
|
+
│ └── config.example.toml # example machine settings
|
|
155
|
+
├── src/
|
|
156
|
+
│ └── neurogen/
|
|
157
|
+
│ ├── cli.py # root Typer app
|
|
158
|
+
│ ├── api.py # public protocol hub
|
|
159
|
+
│ ├── __init__.py # lazy __getattr__, __version__
|
|
160
|
+
│ ├── __main__.py # python -m neurogen
|
|
161
|
+
│ ├── apps/ # Typer CLI apps (train, eval, preprocess, ...)
|
|
162
|
+
│ ├── builders/
|
|
163
|
+
│ ├── config/ # schemas, loader, env/runtime config
|
|
164
|
+
│ ├── data/ # sources, pipelines, datasets, samplers
|
|
165
|
+
│ ├── experiments/ # builtin experiments (neurogen:<name>)
|
|
166
|
+
│ ├── models/
|
|
167
|
+
│ ├── runtime/ # local and Modal backends
|
|
168
|
+
│ ├── training/ # engine, strategies, losses, tracking
|
|
169
|
+
│ └── utils/
|
|
170
|
+
├── plans/
|
|
171
|
+
│ ├── legacy/ # archived pre-0.1 plans
|
|
172
|
+
│ └── releases/ # 0.1.md (this release), 0.2.md, and 0.3.md
|
|
173
|
+
└── tests/
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Tech stack
|
|
177
|
+
|
|
178
|
+
- **Core.** Python 3.12-3.13 and PyTorch.
|
|
179
|
+
- **MLOps.** MLflow for tracking, Modal for GPUs, scikit-learn for metrics.
|
|
180
|
+
- **Data.** Polars for predicate-pushdown loading and multi-worker serving.
|
|
181
|
+
- **Validation.** Pydantic for typed config schemas.
|
|
182
|
+
- **Tooling.** Typer for the CLI and Rich for logging.
|
|
183
|
+
|
|
184
|
+
## Documentation
|
|
185
|
+
|
|
186
|
+
- [ROADMAP.md](ROADMAP.md) — the post-0.1 line.
|
|
187
|
+
- [CHANGELOG.md](CHANGELOG.md) — releases, starting at 0.1.0.
|
|
188
|
+
- [docs/](docs/index.md) — apps, experiments, data pipeline, and training
|
|
189
|
+
internals.
|
|
190
|
+
- [plans/releases/0.1.md](plans/releases/0.1.md) — this release's plan.
|
|
191
|
+
- [docs/legacy-changelog.md](docs/legacy-changelog.md) — pre-0.1 history.
|