diff --git a/demo_linearization.py b/demo_linearization.py index d965f4015b63ccb73c55687c8b1562651edcdf52..6d48d9bb7bbef3aa73fd50473da550832ec28690 100644 --- a/demo_linearization.py +++ b/demo_linearization.py @@ -89,7 +89,7 @@ class _MyCustomJacobian(ift.LinearOperator): # non-linear functions), when facing Fields or Lineariations have already been # implemented in nifty. Therefore in many cases one can "do calculations" with # Linearizations analogous to Fields and the Jacobians get constructed from the -# Jacobians of the promitive operations automatically, using the chain rule: +# Jacobians of the primitive operations automatically, using the chain rule: # Define Operator class MyCustomLinModel(ift.Operator): @@ -115,7 +115,7 @@ class MyCustomLinModel(ift.Operator): # 2) The Operator level (a bit less general, most fail safe) -# Similarly to Fields and Linearozations, also the basic operations are +# Similarly to Fields and Linearizations, also the basic operations are # implemented for Operators. Given for example two operators op1, op2 we can # multiply them together to create a new op3 = op1 * op2. The logic here is: # "take the outputs (results) of op1 and op2 and multiply them together". The @@ -124,7 +124,7 @@ class MyCustomLinModel(ift.Operator): # share the same target space, pointwise multiplication is possible (no # automatic broadcasting!). Nifty, however, provides many broadcasting # operations the user can invoke to help build more general combinations (see -# e.g. `ContractionOperator`) +# e.g. `ContractionOperator`). # a placeholder operator that takes 'x' from the input and passes it along. x = ift.FieldAdapter(scalar_domain, 'x') @@ -133,12 +133,12 @@ y = ift.FieldAdapter(scalar_domain, 'y') # First part of the model. Note that here 'calculations' are performed on # operators to create a new operator (i.E. no inputs are provided yet). model = ift.exp(x) * y -# As "+" is already reserved for adding the output of two operators together +# As "+" is already reserved for adding the output of two operators together, # simple scalar addition has to be performed via a designated operator 'Adder'. # Also, on operator level, the combination of operations has to be performed on -# the same space so the number '3' is cast into a Field on the 'scalar_domain` -# to add it to the output of model. Finally sequential operator application is -# given via the matrix multiplication `@`. +# compatible spaces so the number '3' is cast into a Field on 'scalar_domain` +# to add it to the output of `model``. Finally sequential operator application is +# given via the matrix multiplication operation `@`. MyCustomModel = ift.Adder(ift.full(scalar_domain, 3.)) @ model