Skip to content

Releases: titu1994/pyshac

PySHAC v0.3.5.1

02 Jun 09:24
Compare
Choose a tag to compare

Changelog

Bugfix update:

Fix same value prediction when batch size is smaller or equal to size of execution threads. Due to same value prediction, only one classifier is ever trained.

Now, SHAC.as_seeded() or SHAC.set_seed() must be called before every operation and after restoration in order to ensure non determinsm.

Cause of issue: Deterministic behaviour on multiprocessing systems requires distributed management of global and local seeds.

PySHAC v0.3.5.0

21 Mar 06:35
Compare
Choose a tag to compare

Changelog

Improvements

  • All engines can now be locally seeded for deterministic behavior.

This can be done either with an engine level seed :

shac = pyshac.SHAC(...)
shac.set_seed(seed)  # deterministic from now onwards

Or as a context level seed :

shac = pyshac.SHAC(...)

with shac.as_deterministic(seed):  # deterministic within scope, reverts to random outside it.
    ...

Breaking Changes

  • np.random.seed(seed) no longer seeds the engine.
  • The only way to make the engine deterministic is to use one of the above methods.

PySHAC v0.3.4.1

29 Oct 04:20
Compare
Choose a tag to compare

Changelog

Improvements

  • None can now be used as a value for Discrete Hyper parameters. This is exceptionally useful for scenarios where one does not want to utilize this value. Caveat : Only a single None value will be registered as a parameter, and multiple None in the same Discrete Hyper parameter will not work.

  • Raise RuntimeError if predict is used with no parameters initialized (when predicting without restoring).

Bugfixes

  • Using None as a value before now would cause a crash during casting, however this wasnt caught in tests. This is now properly checked.

PySHAC v0.3.4

27 Oct 18:31
Compare
Choose a tag to compare

Changelog

Improvements

  • Dataset plotting now provides a trend line to show overall trend of evaluation metric during training of the engine.
  • New argument trend_deg for plot_model which decides the degree of the line which fits the dataset. If the dataset is very noisy, it may be advisable to change this parameter to better reflect the dataset trend.

Example

import pyshac
from pyshac.utils.vis_utils import plot_dataset

shac = SHAC(...)
...

plot_dataset(shac.dataset, trend_deg=5)

Bugfixes

  • Removes a flaky test from the Multi* parameter tests

PySHAC v0.3.3

27 Oct 04:38
Compare
Choose a tag to compare

Changelog

Improvements

  • Addition of Multi parameters - MultiDiscreteHyperParameter, MultiUniformContiniousHyperParameter and MultiNormalContiniousHyperParameter.

These multi parameters have an additional argument sample_count which can be used to sample multiple times per step.

Note: The values will be concatenated linearly, so each multi parameter will have a list of values
returned in the resultant OrderedDict. If you wish to flatten the entire search space, you can
use pyshac.flatten_parameters on this OrderedDict.

Example : Creation of a search space of 1000 dice rolls and 500 samples of normally distributed noise.

import pyshac

mp1 = pyshac.MultiDiscreteHP('dice', values=[0, 1, 2, 3, 4, 5, 6], sample_count=1000)
mp2 = pyshac.MultiNormalHP('noise', mean=0.0, std=0.5, sample_count=500)

params = [mp1, mp2]
shac = pyshac.SHAC(params, ...)

PySHAC v0.3.2 / v0.3.2.1

26 Oct 22:20
Compare
Choose a tag to compare

Changelog

Improvement

  • All engines will now accept the keyword save_dir, which will point to the base directory where the shac engine data will be stored.
  • Evaluation speed should be somewhat improved for large batch sizes.

Bugfixes

  • CSVLogger no longer logs the details of the XGBoost model that was trained.
  • Tests now properly check if the engine cannot be restored properly.
  • A bug where the engine fails to sample and crashes all threads using the threading engine is now fixed.

PySHAC v0.3.1

23 Oct 23:44
Compare
Choose a tag to compare

Changelog

  • Added support for Callbacks. History and CSVLogger are the first available.
  • History callback is now returned for all shac.fit(...) and shac.fit_dataset(...) calls.

Example

from pyshac.config.callbacks import History, CSVLogger

shac = SHAC(...)

# History is not needed here, as it is automatically added by default for all .fit / .fit_dataset calls.
callbacks = [History(), CSVLogger('path/to/file.csv')] 

history = shac.fit(evaluation_function, callbacks=callbacks)
OR
history = shac.fit_dataset('path/to/dataset', callbacks=callbacks)

print(history.history)

PySHAC v0.3.0.5

12 Oct 07:55
Compare
Choose a tag to compare

Changelog:

  • Add dataset visualization support for trained engines.
from pyshac.utils.vis_utils import plot_dataset

shac = pyshac.SHAC(...)
shac.fit(...) or shac.fit_dataset(...)

plot_dataset(shac.dataset, to_file='dataset.png', title='Dataset history', eval_label='Loss')
  • Add fit_dataset, which supports engine fitting on external datasets

Uses the provided dataset file to train the engine, instead of using the sequentual halving and classification algorithm directly. The data provided in the path must strictly follow the format of the dataset maintained by the engine.

Standard format of datasets:

            Each dataset csv file must contain an integer id column named "id"
            as its 1st column, followed by several columns describing the values
            taken by the hyper parameters, and the final column must be for
            the the objective criterion, and *must* be named "scores".

            The csv file *must* contain a header, following the above format.

Example

# params corresponds to params in the external dataset
# total_budget is <= the size of the external dataset
# num batches is set such that total budget is divisible by num batches

shac = pyshac.SHAC(params, total_budget, num_batches)

shac.fit_dataset('path/to/external/dataset.csv', presort=True)

Bugfixes:

  • Properly add the readme to Pypi
  • Use codecs for writing compatibility
  • Use io for reading compatibility

PySHAC v0.3

12 Oct 06:18
Compare
Choose a tag to compare
v0.3.0

Fix tests for engine

PySHAC v0.2.1

22 Aug 17:41
Compare
Choose a tag to compare

Changelog :

  • Add get_best_parameters method in Dataset. Can be used to obtain the parameters which either maximize or minimize the objective score.
shac = SHAC(...)
shac.fit(...)

best_parameters = shac.dataset.get_best_parameters(objective='max')