This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from PyTorchLightning/renaming
Renaming
- Loading branch information
Showing
12 changed files
with
88 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from hp_space_generator.component import HPSpaceGenerator | ||
from hp_space_generator.search_strategy import SearchStrategy | ||
from hp_space_generator.random_search_strategy import RandomSearchStrategy | ||
from hp_space_generator.grid_search_strategy import GridSearchStrategy | ||
|
||
__all__ = ["HPSpaceGenerator", "SearchStrategy", "RandomSearchStrategy", "GridSearchStrategy"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
_PATH_ROOT = os.path.dirname(__file__) | ||
|
||
|
||
def _load_py_module(fname, pkg="lightning_hp_engine"): | ||
def _load_py_module(fname, pkg="hp_space_generator"): | ||
spec = spec_from_file_location( | ||
os.path.join(pkg, fname), os.path.join(_PATH_ROOT, pkg, fname) | ||
) | ||
|
@@ -22,12 +22,12 @@ def _load_py_module(fname, pkg="lightning_hp_engine"): | |
REQUIREMENTS = [req.strip() for req in open("requirements.txt").readlines()] | ||
|
||
setup( | ||
name="lightning_hp_engine", | ||
name="hp_space_generator", | ||
version="0.0.1", | ||
description="Run Hyper Parameter Engine around the given choices of hyper-parameters with Grid Search and Random Search strategies", | ||
description="Generator Hyper Parameter space around the given choices of hyper-parameters with Grid Search and Random Search strategies", | ||
author="Kushashwa Ravi Shrimali, Ethan Harris", | ||
author_email="[email protected]", | ||
url="https://github.com/PyTorchLightning/LAI-hyper-parameter-engine", | ||
url="https://github.com/PyTorchLightning/LAI-Hyper-Parameter-Space-Generator", | ||
packages=find_packages(exclude=["tests", "tests.*"]), | ||
install_requires=setup_tools._load_requirements(_PATH_ROOT), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from hp_space_generator import HPSpaceGenerator, RandomSearchStrategy, GridSearchStrategy | ||
|
||
from lightning import LightningWork | ||
|
||
class DoSomethingExtra(LightningWork): | ||
def __init__(self): | ||
super().__init__(run_once=True) | ||
self.hp_list = [] | ||
|
||
def run(self, hp_list): | ||
self.hp_list.extend(hp_list) | ||
|
||
|
||
def test_hp_space_generator_random(): | ||
# Test the HP Component for text classification | ||
hp_config = { | ||
"backbone": ["prajjwal1/bert-tiny", "pra1/bert-medium"], | ||
"learning_rate": [0.00001, 0.01], | ||
} | ||
|
||
space_generator = HPSpaceGenerator() | ||
work_obj = DoSomethingExtra() | ||
space_generator.run(hp_config, num_runs=2, work=work_obj, strategy=RandomSearchStrategy()) | ||
assert len(work_obj.hp_list) != 0, "Didn't generate results..." | ||
|
||
def test_hp_space_generator_grid(): | ||
# Test the HP Space Generator Component for text classification | ||
hp_config = { | ||
"backbone": ["prajjwal1/bert-tiny", "pra1/bert-medium"], | ||
"learning_rate": [0.00001, 0.01], | ||
} | ||
|
||
space_generator = HPSpaceGenerator() | ||
work_obj = DoSomethingExtra() | ||
space_generator.run(hp_config, num_runs=2, work=work_obj, strategy=GridSearchStrategy(should_preprocess=False)) | ||
assert len(work_obj.hp_list) != 0, "Didn't generate results..." |
This file was deleted.
Oops, something went wrong.