{"id":22326072,"url":"https://github.com/mrphys/keras-declarative","last_synced_at":"2025-03-26T06:11:49.240Z","repository":{"id":44706382,"uuid":"412734598","full_name":"mrphys/keras-declarative","owner":"mrphys","description":"A Declarative Keras Interface","archived":false,"fork":false,"pushed_at":"2022-10-25T15:13:50.000Z","size":109,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-01T00:56:42.516Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrphys.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2021-10-02T08:17:31.000Z","updated_at":"2022-04-04T13:12:30.000Z","dependencies_parsed_at":"2022-09-05T08:41:35.136Z","dependency_job_id":null,"html_url":"https://github.com/mrphys/keras-declarative","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrphys%2Fkeras-declarative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrphys%2Fkeras-declarative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrphys%2Fkeras-declarative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrphys%2Fkeras-declarative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrphys","download_url":"https://codeload.github.com/mrphys/keras-declarative/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245598320,"owners_count":20641884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-12-04T02:15:31.472Z","updated_at":"2025-03-26T06:11:49.214Z","avatar_url":"https://github.com/mrphys.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Keras Declarative\n=================\n\n  This package is in alpha stage.\n  This README is a work in progress.\n\n\nCreating Experiments\n--------------------\n\nThere are two types of experiments: **training** experiments, which involve\ntraining a new or existing model, and **testing** experiments, which involve\ntesting an existing model.\n\n.. code-block:: console\n\n  keras.train --config_file path/to/config/file.yaml\n\n  keras.test --config_file path/to/config/file.yaml\n\n\nSpecifying Keras Objects\n------------------------\n\nKeras Declarative automatically discovers objects, such as layers and loss\nfunctions, which are available in core TensorFlow, TensorFlow MRI and TF\nPlayground. This means these objects can be used in the configuration file\nwithout explicit registration.\n\nSerializable Keras objects, such as layers and loss functions, are specified by\na class name and a configuration dictionary. If no parameters should be passed\nto the object, the configuration dictionary may be omitted.\n\n.. code-block:: yaml\n\n  # class name and parameters\n  training:\n    optimizer:\n      class_name: Adam\n      config:\n        learning_rate: 0.001\n\n  # class name only (instantiated with default parameters)\n  training:\n    optimizer: Adam\n\n\nExternal Modules\n----------------\n\nIt is possible to use objects defined in external modules within Keras\nDeclarative, i.e., objects that are not part of either core TensorFlow,\nTensorFlow MRI or TF Playground. This is particularly useful to define\npreprocessing functions but can be used for any other purpose. External modules\ncan be specified with the ``$external`` directive.\n\nAny external modules used during an experiment will be automatically saved to\nthe experiment folder to enable reproducibility.\n\n.. code-block:: yaml\n\n  data:\n    transforms:\n      train:\n        - type: map\n          map:\n            map_func:\n              $external:\n                # Use a preprocessing function defined in an external module.\n                filename: /path/to/preprocessing_fn.py\n                object_name: preprocessing_fn\n                # Any parameters that should be passed to this object may be\n                # specified here.\n                args: null\n                kwargs: null\n\n\nAnchors and Aliases\n-------------------\n\nIf you need to repeat a node more than once, you can anchor it once with the\n``\u0026`` character and then alias it any number of times using the ``*`` character.\nFor example, to use the same list of data transforms for the training and\nvalidation sets, you may use:\n\n.. code-block:: yaml\n\n  data:\n    transforms:\n      train: \u0026transforms\n        # Define the list of transforms here.\n\n      val: *transforms  # Reusing training transforms here.\n\n\nHyperparameter Tuning\n---------------------\n\nKeras Declarative can configure the Keras Tuner to automatically tune one or\nmore parameters.\n\nMost parameters can be set as tunable using the ``$tunable`` directive. For\nexample, to tune the kernel size of a U-Net model, you might use:\n\n.. code-block:: yaml\n\n  model:\n    network:\n      class_name: UNet\n      config:\n        scales: 3\n        base_filters: 32\n        kernel_size:\n          $tunable:\n            type: int\n            int:\n              name: kernel_size\n              min_value: 3\n              max_value: 7\n              step: 2\n\nValid tunable types are `boolean`, `choice`, `fixed`, `float` and `int`. For\nmore details, see https://keras.io/api/keras_tuner/hyperparameters/.\n\nThe tuner type and options can be specified with ``tuning.tuner`` parameter:\n\n.. code-block:: yaml\n\n  tuning:\n    tuner:\n      class_name: Hyperband\n      config:\n        objective:\n          name: val_ssim\n          direction: max\n        max_epochs: 100\n\nAvailable tuners are ``RandomSearch``, ``BayesianOptimization`` and\n``Hyperband``. For more details about these tuners and their options, see\nhttps://keras.io/api/keras_tuner/tuners/.\n\nNote that some parameters cannot be tuned. These include all parameters\nunder ``experiment`` and under ``data.sources``.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrphys%2Fkeras-declarative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrphys%2Fkeras-declarative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrphys%2Fkeras-declarative/lists"}