Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
cf9860a8
Commit
cf9860a8
authored
Jan 21, 2021
by
Simon Ding
Browse files
Adding new pointwise functionality
parent
dee5dfec
Pipeline
#91879
passed with stages
in 11 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/pointwise.py
View file @
cf9860a8
...
...
@@ -110,6 +110,14 @@ def _softplus_helper(v):
return
fv
,
dfv
def
exponentiate
(
v
,
base
):
return
np
.
power
(
base
,
v
)
def
_exponentiate_helper
(
v
,
base
):
return
(
np
.
power
(
base
,
v
),
np
.
log
(
base
)
*
np
.
power
(
base
,
v
))
ptw_dict
=
{
"sqrt"
:
(
np
.
sqrt
,
_sqrt_helper
),
"sin"
:
(
np
.
sin
,
lambda
v
:
(
np
.
sin
(
v
),
np
.
cos
(
v
))),
...
...
@@ -131,5 +139,6 @@ ptw_dict = {
"sign"
:
(
np
.
sign
,
_sign_helper
),
"power"
:
(
np
.
power
,
_power_helper
),
"clip"
:
(
np
.
clip
,
_clip_helper
),
"softplus"
:
(
softplus
,
_softplus_helper
)
"softplus"
:
(
softplus
,
_softplus_helper
),
"exponentiate"
:
(
exponentiate
,
_exponentiate_helper
)
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment