From 9a6c6d94df6f489aa415cdfbbd02a44ae3e122ef Mon Sep 17 00:00:00 2001 From: "Joseph D. Romano" Date: Sun, 23 Jul 2023 23:41:34 -0400 Subject: [PATCH 1/5] Hard-code versions for python and pybind11 in conda --- environment.yml | 4 ++-- install | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/environment.yml b/environment.yml index 53e9d812..d178d18e 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: brush channels: - conda-forge dependencies: - - python #=3.8.2 + - python=3.8.2 - cmake #=3.18.* - eigen #=3.4.* - fmt @@ -10,7 +10,7 @@ dependencies: - gxx >= 12.0 - ninja - ceres-solver - - pybind11 #=2.6.2 + - pybind11=2.6.2 - pytest #=6.2.4 - pydot - scikit-learn diff --git a/install b/install index 21b63c0a..0e8a0690 100755 --- a/install +++ b/install @@ -1,2 +1,2 @@ #!/bin/bash -make -C build -j 4 VERBOSE=1 $1 +make -C build -j 4 VERBOSE=2 $1 From 8f930bf807d99bbba05d1bff105b18f2ffea0c56 Mon Sep 17 00:00:00 2001 From: Guilherme Aldeia Date: Tue, 15 Aug 2023 17:11:35 -0400 Subject: [PATCH 2/5] Uniform weight initialization between mutation options and cx --- src/brush/estimator.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/brush/estimator.py b/src/brush/estimator.py index 2039577d..fd4913af 100644 --- a/src/brush/estimator.py +++ b/src/brush/estimator.py @@ -38,11 +38,20 @@ class BrushEstimator(BaseEstimator): Maximum depth of GP trees in the GP program. Use 0 for no limit. max_size : int, default 0 Maximum number of nodes in a tree. Use 0 for no limit. - cx_prob : float, default 0.9 - Probability of applying the crossover variation when generating the offspring - mutation_options : dict, default {"point":0.2, "insert":0.2, "delete":0.2, "subtree":0.2, "toggle_weight_on":0.1, "toggle_weight_off":0.1} + cx_prob : float, default 1/7 + Probability of applying the crossover variation when generating the offspring, + must be between 0 and 1. + Given that there are `n` mutations, and either crossover or mutation is + used to generate each individual in the offspring (but not both at the + same time), we want to have by default an uniform probability between + crossover and every possible mutation. By setting `cx_prob=1/(n+1)`, and + `1/n` for each mutation, we can achieve an uniform distribution. + mutation_options : dict, default {"point":1/6, "insert":1/6, "delete":1/6, "subtree":1/6, "toggle_weight_on":1/6, "toggle_weight_off":1/6} A dictionary with keys naming the types of mutation and floating point - values specifying the fraction of total mutations to do with that method. + values specifying the fraction of total mutations to do with that method. + The probability of having a mutation is `(1-cx_prob)` and, in case the mutation + is applied, then each mutation option is sampled based on the probabilities + defined in `mutation_options`. The set of probabilities should add up to 1.0. functions: dict[str,float] or list[str], default {} A dictionary with keys naming the function set and values giving the probability of sampling them, or a list of functions which will be weighted uniformly. @@ -95,8 +104,9 @@ def __init__( verbosity=0, max_depth=3, max_size=20, - cx_prob=0.9, - mutation_options = {"point":0.2, "insert":0.2, "delete":0.2, "subtree":0.2, "toggle_weight_on":0.1, "toggle_weight_off":0.1}, + cx_prob= 1/7, + mutation_options = {"point":1/6, "insert":1/6, "delete":1/6, "subtree":1/6, + "toggle_weight_on":1/6, "toggle_weight_off":1/6}, functions: list[str]|dict[str,float] = {}, initialization="grow", random_state=None, From 3a9ebc7d7c4278483cb42d90159287341f3d8e04 Mon Sep 17 00:00:00 2001 From: Guilherme Aldeia Date: Tue, 22 Aug 2023 10:23:27 -0400 Subject: [PATCH 3/5] Spacing --- src/brush/deap_api/nsga2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/brush/deap_api/nsga2.py b/src/brush/deap_api/nsga2.py index b569ad47..e45d011b 100644 --- a/src/brush/deap_api/nsga2.py +++ b/src/brush/deap_api/nsga2.py @@ -54,7 +54,9 @@ def calculate_statistics(ind): # Begin the generational process for gen in range(1, NGEN): - if (use_batch): #batch will be random only if it is not the size of the entire train set. In this case, we dont need to reevaluate the whole pop + # The batch will be random only if it is not the size of the entire train set. + # In this case, we dont need to reevaluate the whole pop + if (use_batch): batch = toolbox.getBatch() fitnesses = toolbox.map(functools.partial(toolbox.evaluate, data=batch), pop) From 646b2df7afa83966d576fcd165c0383226cdab3f Mon Sep 17 00:00:00 2001 From: Joe Romano Date: Mon, 11 Dec 2023 00:21:21 -0500 Subject: [PATCH 4/5] Update README.md Add instructions to install pybrush via a prebuilt wheel file. Eventually, this will be replaced with instructions to install entirely via PyPI, which is currently not supported due to PyPI's requirements for installation on operating systems with older libraries. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 6d330399..41c69c89 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,18 @@ GNU GPLv3, see [LICENSE](https://github.com/cavalab/brush/blob/master/LICENSE) ## Installation +### Installation via Python wheel and `pip` (recommended) + +> **Important**: This method is only currently supported for CPython v3.11 running on the Linux x86_64 platform. Other Python versions and operating systems will be supported in the near future. + +To install a prebuilt version of `pybrush`, download the most recent release of the wheel file on the [Releases page](https://github.com/cavalab/brush/releases/) (e.g., `pybrush-0.1.1-cp311-linux_x86_64.whl`; you may need to expand "Assets" to see the file). Then, navigate to the directory containing the wheel file and install it using `pip`: + +``` +pip install pybrush-0.1.1-cp311-linux_x86_64.whl +``` + +### Manual installation + Clone the repo: From f54104ff12fb9079c90fabe16defad13f751b8c9 Mon Sep 17 00:00:00 2001 From: gAldeia Date: Sun, 21 Apr 2024 08:18:15 -0300 Subject: [PATCH 5/5] Fixing some versions to solve github actions not able to install --- environment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/environment.yml b/environment.yml index d178d18e..0325ff03 100644 --- a/environment.yml +++ b/environment.yml @@ -2,15 +2,15 @@ name: brush channels: - conda-forge dependencies: - - python=3.8.2 + - python>=3.9 #=3.8.2 - cmake #=3.18.* - eigen #=3.4.* - fmt - gcc >= 12.0 - gxx >= 12.0 - ninja - - ceres-solver - - pybind11=2.6.2 + - ceres-solver=2.1.0 + - pybind11>=2.6.2 - pytest #=6.2.4 - pydot - scikit-learn