alchemist-nrel 0.2.1__py3-none-any.whl
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.
- alchemist_core/__init__.py +63 -0
- alchemist_core/acquisition/__init__.py +1 -0
- alchemist_core/acquisition/base_acquisition.py +17 -0
- alchemist_core/acquisition/botorch_acquisition.py +668 -0
- alchemist_core/acquisition/skopt_acquisition.py +330 -0
- alchemist_core/config.py +113 -0
- alchemist_core/data/__init__.py +10 -0
- alchemist_core/data/experiment_manager.py +155 -0
- alchemist_core/data/search_space.py +169 -0
- alchemist_core/events.py +211 -0
- alchemist_core/models/__init__.py +0 -0
- alchemist_core/models/ax_model.py +159 -0
- alchemist_core/models/base_model.py +81 -0
- alchemist_core/models/botorch_model.py +922 -0
- alchemist_core/models/sklearn_model.py +717 -0
- alchemist_core/session.py +603 -0
- alchemist_core/utils/__init__.py +7 -0
- alchemist_nrel-0.2.1.dist-info/METADATA +206 -0
- alchemist_nrel-0.2.1.dist-info/RECORD +54 -0
- alchemist_nrel-0.2.1.dist-info/WHEEL +5 -0
- alchemist_nrel-0.2.1.dist-info/entry_points.txt +2 -0
- alchemist_nrel-0.2.1.dist-info/licenses/LICENSE +13 -0
- alchemist_nrel-0.2.1.dist-info/top_level.txt +4 -0
- api/__init__.py +3 -0
- api/dependencies.py +43 -0
- api/example_client.py +192 -0
- api/main.py +117 -0
- api/middleware/__init__.py +17 -0
- api/middleware/error_handlers.py +127 -0
- api/models/__init__.py +52 -0
- api/models/requests.py +202 -0
- api/models/responses.py +292 -0
- api/routers/__init__.py +5 -0
- api/routers/acquisition.py +164 -0
- api/routers/experiments.py +154 -0
- api/routers/models.py +116 -0
- api/routers/sessions.py +146 -0
- api/routers/variables.py +317 -0
- api/routers/visualizations.py +557 -0
- api/services/__init__.py +5 -0
- api/services/session_store.py +291 -0
- main.py +8 -0
- ui/__init__.py +34 -0
- ui/acquisition_panel.py +878 -0
- ui/custom_widgets.py +105 -0
- ui/experiment_logger.py +205 -0
- ui/gpr_panel.py +613 -0
- ui/notifications.py +654 -0
- ui/pool_viz.py +240 -0
- ui/ui.py +1192 -0
- ui/ui_utils.py +25 -0
- ui/utils.py +33 -0
- ui/variables_setup.py +496 -0
- ui/visualizations.py +1424 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ALchemist Core - Headless Bayesian Optimization Library
|
|
3
|
+
|
|
4
|
+
This package provides the core functionality for active learning and Bayesian
|
|
5
|
+
optimization workflows without UI dependencies.
|
|
6
|
+
|
|
7
|
+
Main Components:
|
|
8
|
+
- OptimizationSession: High-level API for optimization workflows
|
|
9
|
+
- SearchSpace: Define variable search spaces
|
|
10
|
+
- ExperimentManager: Manage experimental data
|
|
11
|
+
- Models: Surrogate modeling backends (sklearn, BoTorch)
|
|
12
|
+
- Acquisition: Acquisition function strategies
|
|
13
|
+
|
|
14
|
+
Example:
|
|
15
|
+
>>> from alchemist_core import OptimizationSession, SearchSpace, ExperimentManager
|
|
16
|
+
>>>
|
|
17
|
+
>>> # Create session
|
|
18
|
+
>>> session = OptimizationSession(
|
|
19
|
+
... search_space=SearchSpace.from_json("variables.json"),
|
|
20
|
+
... experiment_manager=ExperimentManager.from_csv("experiments.csv")
|
|
21
|
+
... )
|
|
22
|
+
>>>
|
|
23
|
+
>>> # Train model
|
|
24
|
+
>>> session.fit_model(backend="sklearn")
|
|
25
|
+
>>>
|
|
26
|
+
>>> # Get next experiment suggestion
|
|
27
|
+
>>> next_point = session.suggest_next(acq_func="ei")
|
|
28
|
+
|
|
29
|
+
Version: 0.2.0-dev (Core-UI Split)
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
__version__ = "0.2.0-dev"
|
|
33
|
+
__author__ = "Caleb Coatney"
|
|
34
|
+
__email__ = "caleb.coatney@nrel.gov"
|
|
35
|
+
|
|
36
|
+
# Core data structures
|
|
37
|
+
from alchemist_core.data.search_space import SearchSpace
|
|
38
|
+
from alchemist_core.data.experiment_manager import ExperimentManager
|
|
39
|
+
|
|
40
|
+
# Event system
|
|
41
|
+
from alchemist_core.events import EventEmitter
|
|
42
|
+
|
|
43
|
+
# Configuration and logging
|
|
44
|
+
from alchemist_core.config import configure_logging, get_logger, set_verbosity
|
|
45
|
+
|
|
46
|
+
# High-level session API
|
|
47
|
+
from alchemist_core.session import OptimizationSession
|
|
48
|
+
|
|
49
|
+
# Public API
|
|
50
|
+
__all__ = [
|
|
51
|
+
# High-level API (recommended entry point)
|
|
52
|
+
"OptimizationSession",
|
|
53
|
+
|
|
54
|
+
# Data structures
|
|
55
|
+
"SearchSpace",
|
|
56
|
+
"ExperimentManager",
|
|
57
|
+
|
|
58
|
+
# Events and logging
|
|
59
|
+
"EventEmitter",
|
|
60
|
+
"configure_logging",
|
|
61
|
+
"get_logger",
|
|
62
|
+
"set_verbosity",
|
|
63
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Acquisition functions package
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
|
|
3
|
+
class BaseAcquisition(ABC):
|
|
4
|
+
def __init__(self, search_space, model=None, random_state=42):
|
|
5
|
+
self.search_space = search_space
|
|
6
|
+
self.model = model
|
|
7
|
+
self.random_state = random_state
|
|
8
|
+
|
|
9
|
+
@abstractmethod
|
|
10
|
+
def update(self, X, y):
|
|
11
|
+
"""Update with training data"""
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def select_next(self, candidate_points=None):
|
|
16
|
+
"""Select the next point to evaluate"""
|
|
17
|
+
pass
|