-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support passing additional activation parameters in parameterizations
- Loading branch information
1 parent
125e4a1
commit 6882355
Showing
3 changed files
with
18 additions
and
1 deletion.
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
Empty file.
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,13 @@ | ||
from cirkit.templates import circuit_templates | ||
from cirkit.templates.circuit_templates.utils import parameterization_to_factory | ||
|
||
|
||
def test_param_activation_kwargs(): | ||
min_var = 0.1 | ||
max_var = 1.0 | ||
stddev_param = circuit_templates.Parameterization(initialization="normal", activation="positive-clamp", | ||
activation_kwargs={"vmin": min_var, "vmax": max_var}) | ||
stddev_param_factory = parameterization_to_factory(stddev_param) | ||
parameter = stddev_param_factory(shape=(1, 1),) | ||
assert (parameter.output.vmin == min_var), f"parameter min value expected: {min_var}, got: {parameter.output.vmin}" | ||
assert (parameter.output.vmax == max_var), f"parameter ma value expected: {max_var}, got: {parameter.output.vmax}" |