Giter VIP home page Giter VIP logo

configspace's People

Contributors

aravind-vasudevan avatar bpkroth avatar dengdifan avatar eddiebergman avatar ennosigaeon avatar filipbartek avatar franchuterivera avatar herilalaina avatar hvarfner avatar janvanrijn avatar jarnorfb avatar jbussemaker avatar jclevesque avatar keggensperger avatar kw-corne avatar mfeurer avatar mickare avatar mlindauer avatar mzeisesap avatar neonkraft avatar pbalapra avatar phmueller avatar raghuspacerajan avatar shukon avatar smohsinali avatar stokasto avatar thomasjpfan avatar waffle-iron avatar yard1 avatar yatoom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

configspace's Issues

Log option for UniformFloatHyperparameter

Hi,

This is more of a question than an issue; sorry if this is the wrong place to post.

I have been working on extending auto-sklearn to include other types of components, and several of these have regularization penalty-esque hyperparameters. For similar types of hyperparameters (e.g., alpha and the thetas for Gaussian processes), the log option is always set to True when creating the respective ConfigSpace hyperparameters.

Does this result in the optimizer using a type of logarithmic search space for the respective hyperparameter (e.g., I just evaluated d=0.11 now consider something like d=0.011 or d=1.1 rather than d=0.12)? Also, are there better/other ways to specify these types of hyperparameters?

Have a good day,
Brandon

Problems integrating with BOHB

I noticed that there is a problem with ordinal hyperparameters.
I do not know if it is a bug or a feature but they do not behave like
integer hyperparameters.

Here is an example of what happens:
Define ConfigSpace in the .pcs file:

batch_size integer [8, 128] [64] log
sequence_size ordinal {128, 256, 512, 1024, 2048, 4096} [512]

Load this ConfigSpace and then sample random values and convert to a vector:
config_space = ... # Some loading code
sample_vector = config_space.sample_configuration().get_array()

#Corresponding Array:
#[ 0.40941199 2. ]

Now convert back to the Configuration:
sample = Configuration(config_space, vector=sample_vector)

Works nicely:
batch_size, Value: 24
sequence_size, Value: '512'
*

Add some noise to the vector (BOHB does that when sampling from the model,
it treats ordinal, integer and continuous parameters in the same way)
sample_vector[0] += 0.1
sample_vector[1] += 0.1

#Corresponding Array:
#[ 0.50941199 2.1 ]

Now convert back to the Configuration:
sample = Configuration(config_space, vector=sample_vector)

For some reason sequence_size disappears.
Configuration:
batch_size, Value: 32

Is that intended? Shouldn't ordinal hyperparameter have the same representation as integer hyperparameter when transformed to an array? Now it has representation that is similar to categorical hyperparameter.

Neighborhood broken

Running SMAC3 on the algorithm SparrowToRiss, I get sometimes the following error:

  File "/work/ws/nemo/fr_tl1023-aclib-0/aclib2-master/configurators/smac3_warm/smac/optimizer/smbo.py", line 294, in _get_next_by_local_search
    configuration, acq_val = self.acq_optimizer.maximize(start_point)
  File "/work/ws/nemo/fr_tl1023-aclib-0/aclib2-master/configurators/smac3_warm/smac/optimizer/local_search.py", line 94, in maximize
    for neighbor in all_neighbors:
  File "/home/fr/fr_fr/fr_tl1023/anaconda3/lib/python3.5/site-packages/ConfigSpace/util.py", line 247, in get_one_exchange_neighbourhood
    new_configuration.is_valid_configuration()
  File "/home/fr/fr_fr/fr_tl1023/anaconda3/lib/python3.5/site-packages/ConfigSpace/configuration_space.py", line 1043, in is_valid_configuration
    self._vector, allow_inactive_with_values=self.allow_inactive_with_values)
  File "/home/fr/fr_fr/fr_tl1023/anaconda3/lib/python3.5/site-packages/ConfigSpace/configuration_space.py", line 665, in _check_configuration
    hyperparameter))
ValueError: Hyperparameter instantiation '1.00000000001' (type: <class 'numpy.float64'>) is illegal for hyperparameter rate-limit, Type: UniformInteger, Range: [900000000, 18000000000], Default: 9000000000, on log-scale

The corresponding parameter is
rate-limit [900000000,18000000000][9000000000]il

Please note that I was able to run SMAC3 on this target algorithm previously (roughly 4 months ago), so the bug was introduced recently.

undefined symbol: __intel_sse2_strchr

I have an issue with installing the new configspace version on Nemo (using anaconda).
Even using a complete newly installed anaconda, I get the following error.
Any ideas?

$ python 
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ConfigSpace
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/fr/fr_fr/fr_tl1023/anaconda3/lib/python3.6/site-packages/ConfigSpace/__init__.py", line 33, in <module>
    from ConfigSpace.configuration_space import Configuration, \
ImportError: /home/fr/fr_fr/fr_tl1023/anaconda3/lib/python3.6/site-packages/ConfigSpace/configuration_space.cpython-36m-x86_64-linux-gnu.so: undefined symbol: __intel_sse2_strchr

Conditional Parameters

One function that I commonly use within the OpenML spheres is 'filter setups according to config space'. For this I utilize the ConfigSpace library. I download a list of setups, give it a config space object and only keep the setups that are within this config space. I created a (non-perfect) version of it yesterday in the openml-python-contrib library:
https://github.com/openml/openml-python-contrib/blob/master/openmlcontrib/setups/functions.py

One thing that I couldn't figure out in the documentation of ConfigSpace: how to take into account hyperparameter conditionals. i.e., the libsvm_svc degree is only relevant when the poly kernel is selected. This knowledge is usually available in the Config Space, I just don't know how to extract it.

Documentation

Hi
I really like the concept of configspace. However I find it is hard to use it and further extend it.
I only find the examples at https://automl.github.io/SMAC3

Is there better documentation before I jump into the source code?

Thanks

documentation ?

This is not really an issue but rather an "feature" request..

Could you write any documentation about how we could use this module?

My Goal:
I hope i can use this module combined with auto-sklearn to export the (module + parameter) configuration (preferably to an database). So i can load the configuration (from the Database) and train a model more dynamically.

Using two conditions for one hyperparameter

Is there anywhere documentation or examples how to do this? Currently I am getting the following error:

Traceback (most recent call last):
  File "/home/janvanrijn/projects/sklearn-bot/examples/run_on_study.py", line 54, in <module>
    run()
  File "/home/janvanrijn/projects/sklearn-bot/examples/run_on_study.py", line 38, in run
    configuration_space = sklearnbot.config_spaces.get_config_space(args.classifier_name, None)
  File "/home/janvanrijn/projects/sklearn-bot/sklearnbot/config_spaces/bootstrap.py", line 46, in get_config_space
    return getattr(sklearnbot.config_spaces, classifier_name).get_hyperparameter_search_space(seed)
  File "/home/janvanrijn/projects/sklearn-bot/sklearnbot/config_spaces/neural_network.py", line 104, in get_hyperparameter_search_space
    cs.add_condition(nesterovs_momentum_confition_momentum)
  File "ConfigSpace/configuration_space.py", line 187, in ConfigSpace.configuration_space.ConfigurationSpace.add_condition
  File "ConfigSpace/configuration_space.py", line 273, in ConfigSpace.configuration_space.ConfigurationSpace._check_condition
ValueError: Adding a second condition (different) for a hyperparameter is ambigouos and therefore forbidden. Add a conjunction instead!
Already inserted: mlpclassifier__nesterovs_momentum | mlpclassifier__solver == 'sgd'
New one: mlpclassifier__nesterovs_momentum | mlpclassifier__momentum > 0

ValueError for default value

Whenever i set the default value lesser than 1e-10 for UniformFloatHyperparameter it raises ValueError

`ValueError Traceback (most recent call last)
in ()
25 # For example, gamma can be either "auto" or a fixed float
26 gamma = CategoricalHyperparameter("gamma", ["auto", "value"], default_value="auto") # only rbf, poly, sigmoid
---> 27 gamma_value = UniformFloatHyperparameter("gamma_value", 1e-15, 8, default_value=1e-11)
28 cs.add_hyperparameters([gamma, gamma_value])
29

ConfigSpace/hyperparameters.pyx in ConfigSpace.hyperparameters.UniformFloatHyperparameter.init()

ConfigSpace/hyperparameters.pyx in ConfigSpace.hyperparameters.UniformFloatHyperparameter.check_default()

ValueError: Illegal default value 0.0`

Not sure if i am doing something wrong

KeyError for RandomConfigs

Hi,
the ConfigSpace throws an unexpected error for random configurations. Here an example script (using the spear_qcp example in SMAC3:

import sys

from ConfigSpace.configuration_space import ConfigSpace
from ConfigSpace.io.pcs import read

# see SMAC3 spear_qcp example
with open("target_algorithm/spear-python/spear-params-mixed.pcs") as fp:
    pcs = fp.readlines()
    
cs = read(pcs_string=pcs)

for i in range(10000):
    config = cs.sample_configuration()
    
    #print(config)
    for p in config:
        try:
            print(config[p])
        except KeyError:
            print(p)
            print(config)
            sys.exit(1)

The output is:

KeyError
sp-clause-inversion
Configuration:
  sp-clause-activity-inc, Value: 0.5245793579385227
  sp-clause-decay, Value: 1.793762045021577
  sp-clause-del-heur, Value: '2'
  sp-first-restart, Value: 124
  sp-learned-clause-sort-heur, Value: '7'
  sp-learned-clauses-inc, Value: 1.172033997030427
  sp-learned-size-factor, Value: 0.7146238837315566
  sp-max-res-lit-inc, Value: 1.93385606282595
  sp-max-res-runs, Value: 25
  sp-orig-clause-sort-heur, Value: '15'
  sp-phase-dec-heur, Value: '5'
  sp-rand-phase-dec-freq, Value: '0.05'
  sp-rand-phase-scaling, Value: 0.6488652050952217
  sp-rand-var-dec-freq, Value: '0'
  sp-res-cutoff-cls, Value: 3
  sp-res-cutoff-lits, Value: 180
  sp-res-order-heur, Value: '8'
  sp-resolution, Value: '1'
  sp-restart-inc, Value: 1.3726376426746159
  sp-update-dec-queue, Value: '0'
  sp-use-pure-literal-rule, Value: '0'
  sp-var-activity-inc, Value: 0.512447739865641
  sp-var-dec-heur, Value: '16'
  sp-variable-decay, Value: 1.4303654243518888

Traceback (most recent call last):
  File "/home/lindauer/git/SMAC3/examples/spear_qcp/test_pcs.py", line 18, in <module>
    print(p, config[p])
  File "/home/lindauer/bin/anaconda3/lib/python3.5/site-packages/ConfigSpace-0.3.7-py3.5.egg/ConfigSpace/configuration_space.py", line 1053, in __getitem__
    raise KeyError()
KeyError

The weird think is that the error is not raised if I first print the configuration (see commented print within for-loop)

Allow hyperparameters of wrong type when creating a Configuration

Currently, the type of a hyperparameter has to be correct when creating a configuration from a dictionary, for example it needs to be a float when creating a float hyperparameter. This is especially cumbersome for Constants (their type can't be easily determined by isinstance). The Configuration object should convert the strings to the correct types.

TypeError; Write Conditions with non-string values

from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import CategoricalHyperparameter
from ConfigSpace.conditions import InCondition
from ConfigSpace.read_and_write.pcs_new import write

cs = ConfigurationSpace(seed=12345)

p1 = CategoricalHyperparameter(name="p1", choices=[True, False], default_value=True)
p2 = CategoricalHyperparameter(name="p2", choices=[True, False], default_value=True)
cs.add_hyperparameters([p1,p2])
c1 = InCondition(child=p2, parent=p1, values=[True])
cs.add_condition(c1)

with open("test.pcs", "w") as fh:
    fh.write(write(cs))

Error:

Traceback (most recent call last):
  File "test.py", line 16, in <module>
    fh.write(write(cs))
  File "/home/lindauer/git/ConfigSpace/ConfigSpace/read_and_write/pcs_new.py", line 462, in write
    condition_lines.write(build_condition(condition))
  File "/home/lindauer/git/ConfigSpace/ConfigSpace/read_and_write/pcs_new.py", line 145, in build_condition
    ", ".join(condition.values))
TypeError: sequence item 0: expected str instance, bool found

In response to automl/SMAC3#442

Legal values for hyperparameter

Constants can not be a boolean, neither can they be None. Is there any reason for this? I think there are many cases where we want them to be either of these.

Traceback (most recent call last):
  File "/home/janvanrijn/projects/sklearn-bot/examples/run_on_task.py", line 39, in <module>
    run()
  File "/home/janvanrijn/projects/sklearn-bot/examples/run_on_task.py", line 32, in run
    configuration_space = sklearnbot.config_spaces.get_config_space(args.classifier, None)
  File "/home/janvanrijn/projects/sklearn-bot/sklearnbot/config_spaces/bootstrap.py", line 19, in get_config_space
    return sklearnbot.config_spaces.decision_tree.get_hyperparameter_search_space(seed)
  File "/home/janvanrijn/projects/sklearn-bot/sklearnbot/config_spaces/decision_tree.py", line 21, in get_hyperparameter_search_space
    'max_leaf_nodes', None, meta={'component': 'decisiontreeclassifier'})
  File "ConfigSpace/hyperparameters.pyx", line 122, in ConfigSpace.hyperparameters.Constant.__init__
TypeError: Constant value is of type <class 'NoneType'>, but only the following types are allowed: (<class 'int'>, <class 'float'>, <class 'str'>)

Adding value to Categorical Parameter?

Hi,

Is there a way to add a further value to an already existing parameter?
With some hacks, it was possible before 0.4.0; but after the introduction of Cython, I cannot access all attributes of a parameter anymore.

Best,
Marius

Save a hash of the configuration space as attribute

whenever it is changed, so other applications can easily and cheaply keep track of the current state of the configuration space (calling hash() every time a configuration space comes by might be too expensive).

Type contracts?

Hi,

I see that the code contains large amount of type hints.
This is useful for static analyzers, but as far as I know
python doesn't enforce anything runtime.

You might consider to use PyContracts.
https://pypi.python.org/pypi/PyContracts

In most simple cases, it can use the same type hints from,
and check them runtime.
On the other hand, pycontracts is quite powerful,
and you can define more fine grained conditions,
like a list must have at least 3 item long, or
a file path must exist, etc.

If it slows the code down, (it should not),
then all the checks can be disabled with a single call.

Documentation

Overview of missing parts of the documentation:

  • Add docstrings to all modules
  • Document the utils module
  • Add an illustration of forbidden hyperparameters

AttributeError: 'AndConjunction' object has no attribute 'parent'

If I use get_parents_of() of the ConfigSpace on @1:counter-bump from /data/aad/aclib/target_algorithms/sat/clasp-cssc14/clasp-sat-params-nat.pcs,
I get the following exception:

File "/home/lindauer/.local/lib/python3.5/site-packages/ConfigSpace-0.2.0.dev0-py3.5.egg/ConfigSpace/configuration_space.py", line 393, in get_parents_of
    parents.append(condition.parent)
AttributeError: 'AndConjunction' object has no attribute 'parent'

deactivate_inactive_hyperparameters() fails

Using the deactivate_inactive_hyperparameters() fails in the following example:

from ConfigSpace.io import pcs
from ConfigSpace.util import deactivate_inactive_hyperparameters

with open("/data/aad/aclib2/target_algorithms/sat/satenstein/params.pcs") as fp:
  pcs_str = fp.readlines()
  cs = pcs.read(pcs_str)

config = {'CONadaptpromwalkprob': '0', 'CONadaptwalkprob': 0, 'CONdp': '0.05', 'CONpromdp': '0.05', 'CONpromwp': '0.01', 'CONselectclause': '1', 'CONwp': '0.01', 'DLSalpha': '1.189', 'DLSc': '0.01', 'DLSmaxinc': '10', 'DLSpflat': '0.15', 'DLSps': '0.1', 'DLSrho': '0.5', 'DLSs': '0.01', 'DLSsapsthresh': '-0.1', 'DLSscoringmeasure': '1', 'DLStiebreaking': '1', 'DLSwp': '0.03', 'adaptive': '1', 'adaptivenoisescheme': '1', 'adaptiveprom': '0', 'adaptpromwalkprob': '0', 'adaptwalkprob': '0', 'c': '0.01', 'clausepen': '1', 'decreasingvariable': '3', 'dp': '0.05', 'heuristic': '2', 'novnoise': '0.5', 'performalternatenovelty': '1', 'performrandomwalk': '0', 'phi': '5', 'promdp': '0.05', 'promisinglist': '1', 'promnovnoise': '0.5', 'promphi': '5', 'promtheta': '6', 'promwp': '0.01', 'ps': '0.4', 'randomwalk': '1', 'rdp': '0.05', 'rfp': '0.01', 'rwp': '0.01', 's': '0.01', 'selectclause': '1', 'singleclause': '1', 'smoothingscheme': '1', 'tabu': '1', 'tabusearch': '0', 'theta': '6', 'tiebreaking': '1', 'updateschemepromlist': '3', 'wp': '0.01', 'wpwalk': '0.5'}

config = deactivate_inactive_hyperparameters(config,cs)

with the following message:

Traceback (most recent call last):
  File "test.py", line 10, in <module>
    config = deactivate_inactive_hyperparameters(config,cs)
  File "/home/lindauer/anaconda3/lib/python3.6/site-packages/ConfigSpace/util.py", line 381, in deactivate_inactive_hyperparameters
    if not condition.evaluate(configuration):
  File "/home/lindauer/anaconda3/lib/python3.6/site-packages/ConfigSpace/conditions.py", line 214, in evaluate
    "'%s'" % condition.parent.name)
ValueError: Evaluate must be called with all instanstatiated parent hyperparameters in the conjunction; you are (at least) missing 'CONadaptwalkprob'

I don't understand why since CONadaptwalkprob is part of the config.

Check that a condition is only part of one ConfigurationSpace object

by generating a random number for the configuration space on instantiation. When a condition is added, the configuration space will save it in the condition object, and error if there already is a different random number. Thereby, the bug of having a condition in two configuration spaces is effectively prevented.

Create tag of repo for python 2 support

Would it be possible to create a tag of this repository of the revision which is python 2 compatible? Ideally, this would be a version compatible with the python 2 compatible revision of autosklearn.

Expected equality after pcs-write/read?

I stumbled over the following and I wondered whether this is expected behaviour:
When I write a ConfigSpace-object to a file using the pcs.write() and load it again with pcs.read(), cs == cs_reloaded evaluates to False. From some debugging I get that the attributes _idx_to_hyperparameter, _parents and _hyperparameter_idx are responsible (possibly others too).
I am not very familiar with the ConfigSpace-class, but intuitively this feels like a bug rather than a feature.

Boolean Constants

Constants cannot be defined as a Boolean, categoricals can:

from ConfigSpace.hyperparameters import CategoricalHyperparameter, Constant

# works
a = CategoricalHyperparameter("a", choices(True, False))

# does not work
b = Constant("b", value=True)

AttributeError: module 'ConfigSpace.io' has no attribute 'StringIO'

Latest Master branch on Python 3.6 in a jupyter-notebook (although I don't think that matters)

import ConfigSpace as CS

config_space = CS.ConfigurationSpace()
config_space.add_hyperparameter(CS.UniformFloatHyperparameter('momentum', lower=0, upper=1, default_value=0.9));

print(config_space.sample_configuration().get_dictionary())
print(config_space.sample_configuration())

yields:

{'momentum': 0.7084377317027317}

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-d4fde6c7e983> in <module>()
     17 
     18 print(config_space.sample_configuration().get_dictionary())
---> 19 print(config_space.sample_configuration())

~/repositories/github/ConfigSpace/ConfigSpace/configuration_space.cpython-36m-x86_64-linux-gnu.so in ConfigSpace.configuration_space.Configuration.__repr__()

AttributeError: module 'ConfigSpace.io' has no attribute 'StringIO'

So the config space is working, but the print fails. It also fails if I try to print the config space.
Any idea what's going on?

Module name is not PEP8 compliant

From PEP 8:

Package and Module Names

Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.

Does that mean the module should be 'configspace' rather than 'ConfigSpace'?

New Conditionals

Hi,
I tried the following mini example for the new pcs format:

x1 real [0,10] [0]
x2 categorical {0,1,2,3,4,5,6,7,8,9,10}  [0]
x3 integer [0,10] [0]
x4 ordinal [0,10] [0]

x1 | x2 in {5,6,7,8,9,10} && x3 > 5
x4 | x1 > 0 || x3 < 1 && x4 < 1 

However, it complains

  File "/home/lindauer/anaconda3/lib/python3.5/site-packages/ConfigSpace-0.2.2-py3.5.egg/ConfigSpace/conditions.py", line 239, in __init__
    (child.name, value, parent.name))
ValueError: Hyperparameter 'x1' is conditional on the illegal value '5' of its parent hyperparameter 'x3'

@mfeurer @Krxsy do you have idea what is wrong here?

Equals operator for choices

The order of values for a categorical (=choices) hyperparameter matters and causes two configuration spaces to be unequal although they are equal.

Hyperparameter floating point precision in configuration search space

@hmendozap raised this issue in the auto-sklearn issue tracker:

When adding a UniformFloat or Constant hyperparameter to the configuration space of any component, the string conversion to the 'parameter configuration space file' has only 10 decimal digits precision that mismatches the native float precision (53 bits) when running auto-sklearn and setting the hyperparameter for a component.

I believe this is specific to the pcs writer of SMAC. @mlindauer is this a critical issue that we should fix?

additional meta-data

Would it be possible to add a dict-field to each hyperparameter, that can be optionally left None? In order to keep using ConfigSpace in my projects, I sometimes find the need to store relevant meta-data about a hyperparameter (e.g., OpenML input id) and there is nowhere to store it.

pip install fails if cython is not installed

When installing the package without cython being installed this happens:

pip install ConfigSpace
Collecting ConfigSpace
  Downloading ConfigSpace-0.4.4.tar.gz (841kB)
    100% |████████████████████████████████| 849kB 316kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-6w71v_pm/ConfigSpace/setup.py", line 4, in <module>
        from Cython.Build import cythonize
    ModuleNotFoundError: No module named 'Cython'

Shouldn't there be a way to list cython as a dependency such that pip can install that first?

Illegal value for parent hyperparameter in condition

Maybe I am doing something wrong but this is happening. If I set the lower bound of num_layers to 1 then the problem is fixed. Theoretically it should work even with 2.

Error thrown:
ValueError: Hyperparameter 'num_units_1' is conditional on the illegal value '1' of its parent hyperparameter 'num_layers'

MWE

import ConfigSpace

cs = ConfigSpace.ConfigurationSpace()

max_nr_layers = 6

num_layers = ConfigSpace.UniformIntegerHyperparameter(
        "num_layers",
        lower=2,
        upper=max_nr_layers,
        default_value=2)
cs.add_hyperparameter(num_layers)

# since the configuration will actually be sampled
# we have to check for max number of layers 
for i in range(1, max_nr_layers + 1):

    n_units = ConfigSpace.UniformIntegerHyperparameter(
        "num_units_%d" % i,
        lower=16,
        upper=128,
        default_value=64,
        log=True
    )
    cs.add_hyperparameter(n_units)
    cs.add_condition(
        ConfigSpace.OrConjunction(
            ConfigSpace.GreaterThanCondition(
                n_units,
                num_layers,
                i
            ),
            ConfigSpace.EqualsCondition(
                n_units,
                num_layers,
                i
            )
        )
    )

Removing inactive values from a configuration

Hi,
I'm reading in configurations from a file. Those files contain values for inactive hyperparameters. I stumbled upon this comment, which states that a method to remove inactive hyperparameters from a Configuration was, at some point, a ToDo.
I'd be glad to implement it, but I need a few pointers. To check if a parameter is active, I'd do the same as checking the configuration. Is that about right?
This would be extremely helpful for me and I'd be happy to try and add a method.

UPDATE: I found a method to correct a sampled array. I think this is already doing what I intended.

TypeError: 'module' object is not callable

Using add_configuration_space with a configspace containing an AbstractConjunction results in a TypeError: 'module' object is not callable in:

def __copy__(self):
return self.__class__([copy(comp) for comp in self.components])

copy is not callable and should be used similar to:

def __copy__(self):
return self.__class__(
child=copy.copy(self.child),
parent=copy.copy(self.parent),
value=copy.copy(self.value),
)

Syntax Error during install with Python 3.5

Several Python 2 vs 3 issues still in the code:

File "build/bdist.linux-x86_64/egg/ConfigSpace/io/pyll.py", line 60
    exec pyll_string
                   ^
SyntaxError: Missing parentheses in call to 'exec'

  File "build/bdist.linux-x86_64/egg/ConfigSpace/convert.py", line 70
    print "Reading searchspace..."
                                 ^
SyntaxError: Missing parentheses in call to 'print'


Extracting ConfigSpace-0.1.1-py3.5.egg to /tmp/venv/lib/python3.5/site-packages
  File "/tmp/venv/lib/python3.5/site-packages/ConfigSpace-0.1.1-py3.5.egg/ConfigSpace/convert.py", line 70
    print "Reading searchspace..."
                                 ^
SyntaxError: Missing parentheses in call to 'print'

  File "/tmp/venv/lib/python3.5/site-packages/ConfigSpace-0.1.1-py3.5.egg/ConfigSpace/io/pyll.py", line 60
    exec pyll_string
                   ^
SyntaxError: Missing parentheses in call to 'exec'

Add hierarchical cross-over operator

This would allow in a searchspace like Auto-sklearn to combine the preprocessor and the classifier or two good configurations into a new, even better one.

Roadmap for a faster ConfigSpace

  1. Improve get_one_exchange_neighborhood to work with the configuration vector instead of the configuration dictionary to determine if a hyperparameter is active or not.
  2. Make is_forbidden work with an array of configurations.
  3. Rewrite is_forbidden in Cython
  4. Rewrite evaluate-function for condition checking in Cython.

Broken pcs_new.write()

Hi, unfortunately, the pcs_new.write() writes weird conditions, e.g.:

(@1:counter-bump | @1:S:counterCond == 'yes' && @1:counter-bump | @1:0:restarts in {'F', 'D', 'L', 'x', '+'})

pcs_new.read() also cannot read these conditions and complains.
I think correct would be:
@1:counter-bump | @1:S:counterCond == 'yes' && @1:0:restarts in {'F', 'D', 'L', 'x', '+'}

I hope it is easy to fix.

I attach both the original pcs file (clasp in the old pcs format) and the pcs file generated by pcs_new.write()

pcs_old.txt
pcs_new.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.