libinephany 0.13.7__tar.gz → 0.14.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.
Files changed (65) hide show
  1. libinephany-0.14.0/CODE_VERSION.cfg +1 -0
  2. {libinephany-0.13.7/libinephany.egg-info → libinephany-0.14.0}/PKG-INFO +1 -1
  3. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/observers/local_observers.py +4 -3
  4. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/configs/hyperparameter_configs.py +4 -0
  5. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/schemas/response_schemas.py +18 -0
  6. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/states/hyperparameter_states.py +54 -33
  7. {libinephany-0.13.7 → libinephany-0.14.0/libinephany.egg-info}/PKG-INFO +1 -1
  8. libinephany-0.13.7/CODE_VERSION.cfg +0 -1
  9. {libinephany-0.13.7 → libinephany-0.14.0}/LICENSE +0 -0
  10. {libinephany-0.13.7 → libinephany-0.14.0}/MANIFEST.in +0 -0
  11. {libinephany-0.13.7 → libinephany-0.14.0}/README.md +0 -0
  12. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/__init__.py +0 -0
  13. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/aws/__init__.py +0 -0
  14. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/aws/s3_functions.py +0 -0
  15. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/__init__.py +0 -0
  16. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/observation_utils.py +0 -0
  17. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/observer_pipeline.py +0 -0
  18. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/observers/__init__.py +0 -0
  19. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/observers/base_observers.py +0 -0
  20. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/observers/global_observers.py +0 -0
  21. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/observers/observer_containers.py +0 -0
  22. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/pipeline_coordinator.py +0 -0
  23. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/post_processors/__init__.py +0 -0
  24. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/post_processors/postprocessors.py +0 -0
  25. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/statistic_manager.py +0 -0
  26. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/observations/statistic_trackers.py +0 -0
  27. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/__init__.py +0 -0
  28. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/configs/__init__.py +0 -0
  29. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/configs/observer_config.py +0 -0
  30. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/configs/outer_model_config.py +0 -0
  31. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/schemas/__init__.py +0 -0
  32. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/schemas/agent_info.py +0 -0
  33. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/schemas/inner_task_profile.py +0 -0
  34. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/schemas/observation_models.py +0 -0
  35. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/schemas/request_schemas.py +0 -0
  36. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/schemas/tensor_statistics.py +0 -0
  37. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/pydantic_models/states/__init__.py +0 -0
  38. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/__init__.py +0 -0
  39. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/agent_utils.py +0 -0
  40. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/asyncio_worker.py +0 -0
  41. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/backend_statuses.py +0 -0
  42. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/constants.py +0 -0
  43. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/directory_utils.py +0 -0
  44. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/dropout_utils.py +0 -0
  45. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/enums.py +0 -0
  46. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/error_severities.py +0 -0
  47. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/exceptions.py +0 -0
  48. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/import_utils.py +0 -0
  49. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/optim_utils.py +0 -0
  50. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/random_seeds.py +0 -0
  51. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/samplers.py +0 -0
  52. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/standardizers.py +0 -0
  53. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/torch_distributed_utils.py +0 -0
  54. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/torch_utils.py +0 -0
  55. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/transforms.py +0 -0
  56. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/utils/typing.py +0 -0
  57. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/web_apps/__init__.py +0 -0
  58. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/web_apps/error_logger.py +0 -0
  59. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany/web_apps/web_app_utils.py +0 -0
  60. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany.egg-info/SOURCES.txt +0 -0
  61. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany.egg-info/dependency_links.txt +0 -0
  62. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany.egg-info/requires.txt +0 -0
  63. {libinephany-0.13.7 → libinephany-0.14.0}/libinephany.egg-info/top_level.txt +0 -0
  64. {libinephany-0.13.7 → libinephany-0.14.0}/pyproject.toml +0 -0
  65. {libinephany-0.13.7 → libinephany-0.14.0}/setup.cfg +0 -0
@@ -0,0 +1 @@
1
+ 0.14.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libinephany
3
- Version: 0.13.7
3
+ Version: 0.14.0
4
4
  Summary: Inephany library containing code commonly used by multiple subpackages.
5
5
  Author-email: Inephany <info@inephany.com>
6
6
  License: Apache 2.0
@@ -6,14 +6,13 @@
6
6
 
7
7
  from typing import Any
8
8
 
9
- from loguru import logger
10
-
11
9
  from libinephany.observations import observation_utils, statistic_trackers
12
10
  from libinephany.observations.observation_utils import StatisticStorageTypes
13
11
  from libinephany.observations.observers.base_observers import LocalObserver
14
12
  from libinephany.pydantic_models.schemas.observation_models import ObservationInputs
15
13
  from libinephany.pydantic_models.schemas.tensor_statistics import TensorStatistics
16
14
  from libinephany.pydantic_models.states.hyperparameter_states import HyperparameterStates
15
+ from libinephany.utils import exceptions
17
16
  from libinephany.utils.enums import ModuleTypes
18
17
  from libinephany.utils.transforms import HyperparameterTransformType
19
18
 
@@ -412,7 +411,9 @@ class ActionSchemeOneHot(LocalObserver):
412
411
  def __init__(self, **kwargs) -> None:
413
412
  super().__init__(**kwargs)
414
413
 
415
- logger.warning(f"{self.__class__.__name__} is deprecated and will be removed in an upcoming release.")
414
+ exceptions.warn_once(
415
+ f"{str(self.__class__.__name__)} is deprecated and will be removed in an upcoming release."
416
+ )
416
417
 
417
418
  @property
418
419
  def vector_length(self) -> int:
@@ -293,6 +293,10 @@ class HParamConfigs(BaseModel):
293
293
  token_config: HParamConfig = TokensHParamConfig()
294
294
  samples_config: HParamConfig = SamplesHParamConfig()
295
295
 
296
+ constraints: dict[str, dict[str, Any] | None] | None = {
297
+ "FirstDefaultParamorphConstraint": None,
298
+ }
299
+
296
300
  def override(self, overrides: dict[str, dict[str, Any]] | None) -> None:
297
301
  """
298
302
  :param overrides: None or config overrides to apply.
@@ -37,6 +37,24 @@ class ClientScheduleResponse(BaseModel):
37
37
 
38
38
  response_time: float | None = None
39
39
 
40
+ def get_value_mapping(self) -> dict[str, float | int]:
41
+ """
42
+ :return: Dictionary mapping agent IDs to their values.
43
+ """
44
+
45
+ return {
46
+ agent_id: agent_response.hyperparameter_internal_value for agent_id, agent_response in self.actions.items()
47
+ }
48
+
49
+ def set_values_from_mapping(self, values: dict[str, float | int]) -> None:
50
+ """
51
+ :param values: Dictionary mapping agent IDs to their values.
52
+ """
53
+
54
+ for agent_id, value in values.items():
55
+ if agent_id in self.actions:
56
+ self.actions[agent_id].hyperparameter_internal_value = value
57
+
40
58
 
41
59
  class ClientPolicySchemaResponse(BaseModel):
42
60
  observation_clipping_threshold: float
@@ -309,6 +309,56 @@ class HyperparameterContainer(BaseModel):
309
309
  if isinstance(field_value, Hyperparameter) and field_name not in skip_hparams
310
310
  }
311
311
 
312
+ def get_current_internal_values(self, skip_hparams: list[str] | None = None) -> dict[str, float | int | None]:
313
+ """
314
+ :param skip_hparams: Names of the hyperparameters to not include in the current values vector returned by
315
+ this observation.
316
+ :return: Dictionary mapping hyperparameter names to their current values for this parameter group.
317
+ """
318
+
319
+ if skip_hparams is None:
320
+ skip_hparams = []
321
+
322
+ return {
323
+ field_name: field_value.current_internal_value
324
+ for field_name, field_value in self.__dict__.items()
325
+ if isinstance(field_value, Hyperparameter) and field_name not in skip_hparams
326
+ }
327
+
328
+ def get_current_deltas(self, skip_hparams: list[str] | None = None) -> dict[str, float | int | None]:
329
+ """
330
+ :param skip_hparams: Names of the hyperparameters to not include in the current deltas vector returned by
331
+ this observation.
332
+ :return: Dictionary mapping hyperparameter names to their current deltas for this parameter group.
333
+ """
334
+
335
+ if skip_hparams is None:
336
+ skip_hparams = []
337
+
338
+ return {
339
+ field_name: field_value.current_delta
340
+ for field_name, field_value in self.__dict__.items()
341
+ if isinstance(field_value, Hyperparameter) and field_name not in skip_hparams
342
+ }
343
+
344
+ def set_internal_values(self, internal_values: dict[str, float | int | None]) -> None:
345
+ """
346
+ :param internal_values: Dictionary mapping hyperparameter names to their new internal values.
347
+ """
348
+
349
+ for field_name, field_value in internal_values.items():
350
+ if hasattr(self, field_name) and isinstance(getattr(self, field_name), Hyperparameter):
351
+ getattr(self, field_name).internal_value = field_value
352
+
353
+ def set_deltas(self, deltas: dict[str, float | int | None]) -> None:
354
+ """
355
+ :param deltas: Dictionary mapping hyperparameter names to their new deltas.
356
+ """
357
+
358
+ for field_name, field_value in deltas.items():
359
+ if hasattr(self, field_name) and isinstance(getattr(self, field_name), Hyperparameter):
360
+ getattr(self, field_name).delta = field_value
361
+
312
362
  def set_sampled_initial_values(
313
363
  self, sample_initial_external_values: dict[str, np.ndarray | float | int | None]
314
364
  ) -> None:
@@ -382,39 +432,10 @@ class ParameterGroupHParams(HyperparameterContainer):
382
432
  name=hyperparameter_name,
383
433
  )
384
434
 
385
- return cls(parameter_group_name=parameter_group_name, **hyperparameters)
386
-
387
- def get_current_internal_values(self, skip_hparams: list[str] | None = None) -> dict[str, float | int | None]:
388
- """
389
- :param skip_hparams: Names of the hyperparameters to not include in the current values vector returned by
390
- this observation.
391
- :return: Dictionary mapping hyperparameter names to their current values for this parameter group.
392
- """
393
-
394
- if skip_hparams is None:
395
- skip_hparams = []
396
-
397
- return {
398
- field_name: field_value.current_internal_value
399
- for field_name, field_value in self.__dict__.items()
400
- if isinstance(field_value, Hyperparameter) and field_name not in skip_hparams
401
- }
402
-
403
- def get_current_deltas(self, skip_hparams: list[str] | None = None) -> dict[str, float | int | None]:
404
- """
405
- :param skip_hparams: Names of the hyperparameters to not include in the current deltas vector returned by
406
- this observation.
407
- :return: Dictionary mapping hyperparameter names to their current deltas for this parameter group.
408
- """
409
-
410
- if skip_hparams is None:
411
- skip_hparams = []
412
-
413
- return {
414
- field_name: field_value.current_delta
415
- for field_name, field_value in self.__dict__.items()
416
- if isinstance(field_value, Hyperparameter) and field_name not in skip_hparams
417
- }
435
+ return cls(
436
+ parameter_group_name=parameter_group_name,
437
+ **hyperparameters,
438
+ )
418
439
 
419
440
  def get_hyperparameter_transform_types(
420
441
  self, skip_hparams: list[str] | None = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libinephany
3
- Version: 0.13.7
3
+ Version: 0.14.0
4
4
  Summary: Inephany library containing code commonly used by multiple subpackages.
5
5
  Author-email: Inephany <info@inephany.com>
6
6
  License: Apache 2.0
@@ -1 +0,0 @@
1
- 0.13.7
File without changes
File without changes
File without changes
File without changes