hypergan 2.0.0a1__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.
Files changed (140) hide show
  1. hypergan/__init__.py +39 -0
  2. hypergan/__main__.py +5 -0
  3. hypergan/_build_provenance.json +1 -0
  4. hypergan/_file_lock.py +32 -0
  5. hypergan/api.py +2221 -0
  6. hypergan/artifacts.py +334 -0
  7. hypergan/autoencoder_components.py +60 -0
  8. hypergan/background_poll.py +74 -0
  9. hypergan/bounded_cli_output.py +562 -0
  10. hypergan/bounded_observer.py +278 -0
  11. hypergan/checkpoint_compatibility.py +203 -0
  12. hypergan/checkpoints.py +902 -0
  13. hypergan/cli.py +2165 -0
  14. hypergan/color_words.py +288 -0
  15. hypergan/colorization_components.py +360 -0
  16. hypergan/colorization_data.py +256 -0
  17. hypergan/colorization_metrics.py +168 -0
  18. hypergan/config.py +1041 -0
  19. hypergan/console_settings.py +87 -0
  20. hypergan/cpu_worker_service.py +575 -0
  21. hypergan/cpu_workers.py +125 -0
  22. hypergan/data.py +429 -0
  23. hypergan/datasets.py +6 -0
  24. hypergan/diff_augment.py +131 -0
  25. hypergan/distributed.py +110 -0
  26. hypergan/distributed_checkpoints.py +558 -0
  27. hypergan/distributed_commit.py +297 -0
  28. hypergan/distributed_training.py +733 -0
  29. hypergan/diversity_metrics.py +175 -0
  30. hypergan/evaluation_cli.py +22 -0
  31. hypergan/evaluation_snapshot.py +28 -0
  32. hypergan/event_views.py +500 -0
  33. hypergan/execution.py +360 -0
  34. hypergan/execution_preflight.py +264 -0
  35. hypergan/execution_profiles.py +142 -0
  36. hypergan/gpu_inventory.py +687 -0
  37. hypergan/hndl_augmentation.py +40 -0
  38. hypergan/hndl_networks.py +42 -0
  39. hypergan/image_cache.py +66 -0
  40. hypergan/image_components.py +326 -0
  41. hypergan/image_data.py +96 -0
  42. hypergan/image_grids.py +151 -0
  43. hypergan/image_metrics.py +121 -0
  44. hypergan/inspection.py +1956 -0
  45. hypergan/interval_evaluation.py +294 -0
  46. hypergan/item_data.py +165 -0
  47. hypergan/metric_evaluation.py +425 -0
  48. hypergan/metric_evaluation_worker.py +136 -0
  49. hypergan/metric_examples.py +81 -0
  50. hypergan/metric_plugins.py +339 -0
  51. hypergan/metrics.py +407 -0
  52. hypergan/metrics_reducer/__init__.py +12 -0
  53. hypergan/model_description.py +651 -0
  54. hypergan/model_file.py +1014 -0
  55. hypergan/models/gaussian-grid.toml +48 -0
  56. hypergan/network_config.py +131 -0
  57. hypergan/networks/autoencoder_offset.hndl +1 -0
  58. hypergan/networks/colorization_conv_head.hndl +6 -0
  59. hypergan/networks/colorization_dcgan256.hndl +14 -0
  60. hypergan/networks/colorization_dinov3_multidepth.hndl +20 -0
  61. hypergan/networks/colorization_dinov3_patch_tokens.hndl +19 -0
  62. hypergan/networks/colorization_encoder_features.hndl +19 -0
  63. hypergan/networks/colorization_feature_concat.hndl +2 -0
  64. hypergan/networks/colorization_feature_project.hndl +3 -0
  65. hypergan/networks/colorization_generator16.hndl +69 -0
  66. hypergan/networks/colorization_generator32.hndl +69 -0
  67. hypergan/networks/colorization_joint_score.hndl +2 -0
  68. hypergan/networks/colorization_linear_head.hndl +3 -0
  69. hypergan/networks/colorization_multidepth_projection.hndl +18 -0
  70. hypergan/networks/colorization_multiscale_score.hndl +2 -0
  71. hypergan/networks/colorization_pixel_features.hndl +8 -0
  72. hypergan/networks/colorization_pixel_head.hndl +17 -0
  73. hypergan/networks/colorization_query.hndl +2 -0
  74. hypergan/networks/colorization_random_project.hndl +2 -0
  75. hypergan/networks/colorization_scale_head16.hndl +8 -0
  76. hypergan/networks/colorization_scale_head32.hndl +10 -0
  77. hypergan/networks/colorization_scale_head4.hndl +4 -0
  78. hypergan/networks/colorization_scale_head8.hndl +6 -0
  79. hypergan/networks/image_attention.hndl +15 -0
  80. hypergan/networks/image_critic_score.hndl +6 -0
  81. hypergan/networks/image_encoder.hndl +17 -0
  82. hypergan/networks/image_feature_head.hndl +9 -0
  83. hypergan/networks/image_generator.hndl +13 -0
  84. hypergan/networks/image_pixel.hndl +7 -0
  85. hypergan/networks/image_pixel_block.hndl +16 -0
  86. hypergan/networks/image_resnet_stage1.hndl +7 -0
  87. hypergan/networks/image_resnet_stage2.hndl +2 -0
  88. hypergan/networks/image_resnet_stage3.hndl +2 -0
  89. hypergan/networks/reference.hndl +6 -0
  90. hypergan/numerical_policy.py +95 -0
  91. hypergan/objective_program.py +425 -0
  92. hypergan/observation_io.py +150 -0
  93. hypergan/particlegan_integration.py +134 -0
  94. hypergan/plugin_functions.py +94 -0
  95. hypergan/ports.py +9 -0
  96. hypergan/pretrained_providers.py +104 -0
  97. hypergan/preview_snapshot.py +229 -0
  98. hypergan/preview_worker.py +128 -0
  99. hypergan/previews.py +590 -0
  100. hypergan/provenance.py +187 -0
  101. hypergan/queue.py +819 -0
  102. hypergan/recipe_generator.py +691 -0
  103. hypergan/recipes.py +279 -0
  104. hypergan/registry.py +1337 -0
  105. hypergan/replicated_execution.py +487 -0
  106. hypergan/replicated_worker.py +184 -0
  107. hypergan/run_controller.py +990 -0
  108. hypergan/run_events.py +185 -0
  109. hypergan/run_requests.py +277 -0
  110. hypergan/run_signals.py +42 -0
  111. hypergan/run_state.py +80 -0
  112. hypergan/single_execution.py +225 -0
  113. hypergan/snapshot_renderer.py +71 -0
  114. hypergan/summary.py +336 -0
  115. hypergan/toml_writer.py +125 -0
  116. hypergan/training.py +543 -0
  117. hypergan/web_assets/THIRD_PARTY_LICENSES.txt +289 -0
  118. hypergan/web_assets/__init__.py +25 -0
  119. hypergan/web_assets/app.js +22 -0
  120. hypergan/web_assets/index.html +225 -0
  121. hypergan/web_assets/logo.png +0 -0
  122. hypergan/web_assets/runs.css +75 -0
  123. hypergan/web_assets/runs.js +203 -0
  124. hypergan/web_assets/style.css +871 -0
  125. hypergan/web_assets/view-worker.js +204 -0
  126. hypergan/web_autostart.py +1283 -0
  127. hypergan/web_dev.py +132 -0
  128. hypergan/web_files.py +83 -0
  129. hypergan/web_launch.py +272 -0
  130. hypergan/web_schema.py +165 -0
  131. hypergan/web_server.py +1323 -0
  132. hypergan/web_service.py +651 -0
  133. hypergan/web_session.py +191 -0
  134. hypergan/workspace.py +325 -0
  135. hypergan-2.0.0a1.dist-info/METADATA +328 -0
  136. hypergan-2.0.0a1.dist-info/RECORD +140 -0
  137. hypergan-2.0.0a1.dist-info/WHEEL +5 -0
  138. hypergan-2.0.0a1.dist-info/entry_points.txt +2 -0
  139. hypergan-2.0.0a1.dist-info/licenses/LICENSE +21 -0
  140. hypergan-2.0.0a1.dist-info/top_level.txt +1 -0
hypergan/__init__.py ADDED
@@ -0,0 +1,39 @@
1
+ """HyperGAN's lightweight public package.
2
+
3
+ Training dependencies are loaded only when a training or sampling API is used.
4
+ """
5
+
6
+ __version__ = "2.0.0a1"
7
+
8
+ from .api import __all__ as _api_all
9
+
10
+ __all__ = tuple(_api_all)
11
+ del _api_all
12
+
13
+
14
+ def __getattr__(name: str):
15
+ if name.startswith("_"):
16
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
17
+ import importlib
18
+
19
+ # The metrics module is callable as hg.metrics(run) and provides module attributes
20
+ if name == "metrics":
21
+ return importlib.import_module(".metrics", __name__)
22
+
23
+ # Guard: only allow public symbols declared in __all__
24
+ if name in __all__:
25
+ api = importlib.import_module(".api", __name__)
26
+ if hasattr(api, name):
27
+ return getattr(api, name)
28
+
29
+ # Allow direct submodule access (e.g. hypergan.cli, hypergan.config)
30
+ try:
31
+ return importlib.import_module(f".{name}", __name__)
32
+ except ImportError:
33
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None
34
+
35
+
36
+ def __dir__() -> list[str]:
37
+ # Return __all__ plus standard module dunder attributes present in globals
38
+ dunders = {k for k in globals() if k.startswith("__") and k.endswith("__")}
39
+ return sorted(dunders | set(__all__))
hypergan/__main__.py ADDED
@@ -0,0 +1,5 @@
1
+ """Support ``python -m hypergan``."""
2
+
3
+ from .cli import main
4
+
5
+ raise SystemExit(main())
@@ -0,0 +1 @@
1
+ {"commit": "f1346125d29376caf548f27ac1ce4c7ed51895a5", "dirty": false, "schema_version": 1}
hypergan/_file_lock.py ADDED
@@ -0,0 +1,32 @@
1
+ """Exclusive descriptor locks shared by queue writers and run-lock probes."""
2
+ import errno
3
+ import os
4
+ import time
5
+
6
+
7
+ def lock_file(fd, *, blocking=False):
8
+ if os.name == 'nt':
9
+ import msvcrt
10
+ while True:
11
+ # Match run_state.run_lock: the first byte can lie beyond EOF.
12
+ os.lseek(fd, 0, os.SEEK_SET)
13
+ try:
14
+ msvcrt.locking(fd, msvcrt.LK_NBLCK, 1)
15
+ return
16
+ except OSError as error:
17
+ if not blocking or error.errno not in (errno.EACCES, errno.EAGAIN, errno.EDEADLK):
18
+ raise
19
+ time.sleep(.01)
20
+ else:
21
+ import fcntl
22
+ fcntl.flock(fd, fcntl.LOCK_EX | (0 if blocking else fcntl.LOCK_NB))
23
+
24
+
25
+ def unlock_file(fd):
26
+ if os.name == 'nt':
27
+ import msvcrt
28
+ os.lseek(fd, 0, os.SEEK_SET)
29
+ msvcrt.locking(fd, msvcrt.LK_UNLCK, 1)
30
+ else:
31
+ import fcntl
32
+ fcntl.flock(fd, fcntl.LOCK_UN)