mindscience.common

mindscience.common.AdaHessian

The Adahessian optimizer, which performs optimization using second-order information from the diagonal elements of the Hessian matrix.

mindscience.common.batched_hessian

Calculate Hessian matrix of network model.

mindscience.common.batched_jacobian

Calculate Jacobian matrix of network model.

mindscience.common.get_2d_sin_cos_pos_embed

Construct 2D sine-cosine positional embeddings on a two-dimensional grid.

mindscience.common.get_loss_metric

Gets the loss function.

mindscience.common.get_multi_step_lr

Generate decay learning rate array of each parameter group by gamma once the number of epoch reaches one of the milestones.

mindscience.common.get_poly_lr

Generate polynomial decay learning rate array.

mindscience.common.get_warmup_cosine_annealing_lr

Calculates learning rate base on cosine decay function.

mindscience.common.glorot_uniform

Glorot uniform.

mindscience.common.lecun_init

Lecun init.

mindscience.common.MTLWeightedLoss

Compute the MTL strategy weighted multi-task losses automatically.

mindscience.common.patchify

Convert an image-like tensor into a sequence of flattened patches.

mindscience.common.pixel_shuffle

Applies a pixel_shuffle operation over an input signal composed of several input planes.

mindscience.common.pixel_unshuffle

Applies a pixel_unshuffle operation over an input signal composed of several input planes.

mindscience.common.PixelShuffle

Applies a pixelshuffle operation over an input signal composed of several input planes.

mindscience.common.PixelUnshuffle

Applies a pixelunshuffle operation over an input signal composed of several input planes.

mindscience.common.RelativeRMSELoss

Relative Root Mean Square Error (RRMSE) is the root mean squared error normalized by the root-mean-square value where each residual is scaled against the actual value.

mindscience.common.SpectralNorm

Applies spectral normalization to a parameter in the given module.

mindscience.common.to_2tuple

Convert an integer or a tuple of integers to a 2-tuple.

mindscience.common.to_3tuple

Convert an integer or a tuple of integers to a 3-tuple.

mindscience.common.unpatchify

Convert a sequence of flattened patches back into an image-like tensor.

mindscience.common.WaveletTransformLoss

The multi-level wavelet transformation losses.