Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure Parameters around Layered class #1045

Merged
merged 42 commits into from
Feb 15, 2021
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ec2d41a
Restructure around overridable
jrapin Feb 11, 2021
d3c567c
fix
jrapin Feb 11, 2021
85ecb91
useless
jrapin Feb 11, 2021
5032364
wip
jrapin Feb 11, 2021
2bfd6e7
fix
jrapin Feb 11, 2021
2ae1610
propagatelayers
jrapin Feb 12, 2021
22ec116
doc
jrapin Feb 12, 2021
cf02f80
Prepare integer
jrapin Feb 12, 2021
47ed796
name
jrapin Feb 12, 2021
bd1fb0d
fix
jrapin Feb 12, 2021
c88203f
fixes
jrapin Feb 12, 2021
bfbc9e0
step
jrapin Feb 12, 2021
a0cdf50
working_revert
jrapin Feb 12, 2021
c775aed
reformat
jrapin Feb 12, 2021
9c37dbe
somefixes
jrapin Feb 12, 2021
20586ba
working
jrapin Feb 12, 2021
1a23440
cleaning
jrapin Feb 12, 2021
6c552a2
prints
jrapin Feb 12, 2021
db2902c
move
jrapin Feb 12, 2021
dae5f91
header
jrapin Feb 12, 2021
f7f0a38
remove_attr
jrapin Feb 12, 2021
9e43ad5
prints
jrapin Feb 12, 2021
65d010c
print
jrapin Feb 12, 2021
ba3eed7
fix
jrapin Feb 12, 2021
d2e3370
mypy
jrapin Feb 12, 2021
0e94d22
fix
jrapin Feb 12, 2021
fe93831
module
jrapin Feb 12, 2021
b121776
enum
jrapin Feb 12, 2021
2295e10
Add array casting
jrapin Feb 12, 2021
89ec03f
Start cache deletion
jrapin Feb 12, 2021
6e82ce2
deep
jrapin Feb 12, 2021
4e0ac95
bound_layer
jrapin Feb 12, 2021
58883f3
wip
jrapin Feb 14, 2021
1f5bc65
skip
jrapin Feb 14, 2021
6d14420
sample
jrapin Feb 14, 2021
88856f0
wip
jrapin Feb 14, 2021
146a59c
Merge branch 'master' into overridable
jrapin Feb 15, 2021
1b50443
Merge branch 'master' into overridable
jrapin Feb 15, 2021
74785b4
merge
jrapin Feb 15, 2021
816a254
move_logic
jrapin Feb 15, 2021
6cb68ae
fix
jrapin Feb 15, 2021
fb8acf7
nits
jrapin Feb 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Start cache deletion
jrapin committed Feb 12, 2021
commit 89ec03f694f10505134b6f99e7713d285b697858
4 changes: 3 additions & 1 deletion nevergrad/parametrization/core.py
Original file line number Diff line number Diff line change
@@ -201,6 +201,7 @@ def set_standardized_data(
sent_reference, self.__class__
), f"Expected {type(self)} but got {type(sent_reference)} as reference"
self._check_frozen()
del self.value # remove all cached information
self._internal_set_standardized_data(
np.array(data, copy=False), reference=sent_reference, deterministic=deterministic
)
@@ -227,7 +228,7 @@ def get_value_hash(self) -> tp.Hashable:
if isinstance(val, (str, bytes, float, int)):
return val
elif isinstance(val, np.ndarray):
return val.tobytes() # type: ignore
return val.tobytes()
else:
raise errors.UnsupportedParameterOperationError(
f"Value hash is not supported for object {self.name}"
@@ -343,6 +344,7 @@ def spawn_child(self: P, new_value: tp.Optional[tp.Any] = None) -> P:
setattr(child, attribute, container)
for key, val in self._subobjects.items():
container[key] = val.spawn_child()
del child.value # clear cache
if new_value is not None:
child.value = new_value
return child