pub struct IlluminateResidual {
factor: Arc<InteractionFactor>,
response: DMatrix<Complex>,
value: DMatrix<Complex>,
}Expand description
What InteractionFactor::record saves for its pullback: the shared factor and
the total incident response B + C X and scattered fields of the requested columns.
Fields§
§factor: Arc<InteractionFactor>§response: DMatrix<Complex>§value: DMatrix<Complex>Implementations§
Source§impl IlluminateResidual
impl IlluminateResidual
Sourcepub fn local_shapes(&self) -> impl ExactSizeIterator<Item = (usize, usize)>
pub fn local_shapes(&self) -> impl ExactSizeIterator<Item = (usize, usize)>
Shapes of the recorded local blocks, in particle order.
Sourcepub const fn value(&self) -> &DMatrix<Complex>
pub const fn value(&self) -> &DMatrix<Complex>
The scattered coefficients, one column per incident field, which the pullback reads.
Sourcepub fn shape(&self) -> (usize, usize)
pub fn shape(&self) -> (usize, usize)
The shape of the scattered coefficients: channels and incident fields.
Sourcepub fn pushforward(
&self,
local: &[DMatrix<Complex>],
coupling: &DMatrix<Complex>,
incident: &DMatrix<Complex>,
) -> Result<DMatrix<Complex>>
pub fn pushforward( &self, local: &[DMatrix<Complex>], coupling: &DMatrix<Complex>, incident: &DMatrix<Complex>, ) -> Result<DMatrix<Complex>>
Directional derivative of the requested scattered columns for tangents of
the local blocks, coupling and incident fields. Uses the shared LU once:
(I - T C) dX = dT (B + C X) + T (dB + dC X).
Sourcepub fn pullback(
&self,
cotangent: &DMatrix<Complex>,
) -> Result<IlluminateGradient>
pub fn pullback( &self, cotangent: &DMatrix<Complex>, ) -> Result<IlluminateGradient>
Gradients of T, C and B from cotangent, the gradient of a real loss with
respect to the scattered fields.
With Y = (I - T C)⁻ᴴ G from the shared LU, the gradients are Y (B + C X)ᴴ on
each local block, Tᴴ Y Xᴴ and Tᴴ Y. The pullback has no Rayon reduction; the
LU solve and the matrix products run in faer with the worker count of
linalg.
Trait Implementations§
Source§impl Debug for IlluminateResidual
impl Debug for IlluminateResidual
Source§impl SavedState for IlluminateResidual
impl SavedState for IlluminateResidual
Auto Trait Implementations§
impl Freeze for IlluminateResidual
impl RefUnwindSafe for IlluminateResidual
impl Send for IlluminateResidual
impl Sync for IlluminateResidual
impl Unpin for IlluminateResidual
impl UnwindSafe for IlluminateResidual
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.