Skip to content

Commit 68f00c4

Browse files
committed
spelling and grammar
1 parent b90ee24 commit 68f00c4

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/differentials/abstract_zero.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
AbstractZero <: AbstractDifferential
33
4-
This is zero-like differential types.
5-
If a AD system encounter a propagator taking as input only subtypes of `AbstractZero` then
6-
it can stop performing any AD operations, as all propagator are linear functions, and thus
4+
This abstract type encompasses zero-like differential types.
5+
If an AD system encounters a propagator that takes as input only subtypes of `AbstractZero`,
6+
then it can stop performing AD operations. All propagators are linear functions, and thus
77
the final result will be zero.
88
99
All `AbstractZero` subtypes are singleton types.
10-
There are two of them [`Zero()`](@ref) and [`DoesNotExist()`](@ref).
10+
There are two of them: [`Zero()`](@ref) and [`DoesNotExist()`](@ref).
1111
"""
1212
abstract type AbstractZero <: AbstractDifferential end
1313
Base.iszero(::AbstractZero) = true
@@ -28,7 +28,7 @@ Base.:/(z::AbstractZero, ::Any) = z
2828
2929
The additive identity for differentials.
3030
This is basically the same as `0`.
31-
A derivative of `Zero()`. does not propagate through the primal function.
31+
A derivative of `Zero()` does not propagate through the primal function.
3232
"""
3333
struct Zero <: AbstractZero end
3434

@@ -43,21 +43,21 @@ Base.zero(::Type{<:AbstractDifferential}) = Zero()
4343
DoesNotExist() <: AbstractZero
4444
4545
This differential indicates that the derivative does not exist.
46-
It is the differential for a Primal type that is not differentiable.
47-
Such an Integer, or Boolean (when not being used as a represention of a value that normally
48-
would be a floating point.)
49-
The only valid way to pertube such a values is to not change it at all.
50-
As such, `DoesNotExist` is functionally identical to `Zero()`,
51-
but provides additional semantic information.
46+
It is the differential for primal types that are not differentiable,
47+
such as integers or booleans (when they are not being used to represent
48+
floating-point values).
49+
The only valid way to perturb such values is to not change them at all.
50+
As a consequence, `DoesNotExist` is functionally identical to `Zero()`,
51+
but it provides additional semantic information.
5252
53-
If you are adding this differential to a primal then something is wrong.
54-
A optimization package making use of this might like to check for such a case.
53+
If you are adding this differential to a primal, then something is wrong.
54+
An optimization package making use of this might want to check for such a case.
5555
5656
!!! note:
57-
This does not indicate that the derivative it is not implemented,
57+
This does not indicate that the derivative is not implemented,
5858
but rather that mathematically it is not defined.
5959
60-
This mostly shows up as the deriviative with respect to dimension, index, or size
60+
This mostly shows up as the derivative with respect to dimension, index, or size
6161
arguments.
6262
```
6363
function rrule(fill, x, len::Int)

0 commit comments

Comments
 (0)