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
4cae8483
Commit
4cae8483
authored
Jun 11, 2021
by
Martin Reinecke
Browse files
tweaks
parent
febe7090
Pipeline
#103372
passed with stages
in 14 minutes and 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/custom_nonlinearities.py
View file @
4cae8483
...
...
@@ -19,15 +19,15 @@ import numpy as np
# In NIFTy, users can add hand-crafted point-wise nonlinearities that are then
# available for `Field`, `MultiField`, `Linearization` and `Operator`. This
# guide
shows an example
how this is done.
# guide
illustrates
how this is done.
# Suppose
,
we would like to use the function f(x) = x*exp(x)
point-wise in a
n
# operator chain. This function is called "myptw" in the following. We
# Suppose
that
we would like to use the
point-wise
function f(x) = x*exp(x)
i
n
#
an
operator chain. This function is called "myptw" in the following. We
# introduce this function to NIFTy by implementing two functions.
# First, one that takes a `numpy.ndarray` as an input, applies the point-wise
# mapping and returns the result as a `numpy.ndarray`
(
of the same shape
)
.
# Second, a function that takes a
n
`numpy.ndarray` as an input and returns two
# mapping and returns the result as a `numpy.ndarray` of the same shape.
# Second, a function that takes a `numpy.ndarray` as an input and returns two
# `numpy.ndarray`s: the application of the nonlinearity (same as before) and
# the derivative.
...
...
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