bte.nsr.reduced_collision#

Module Contents#

Classes#

Enforcer

Base class for all neural network modules.

ReductionCollision

Base class for all neural network modules.

Functions#

orthonormalize(vectors)

Orthonormalizes the vectors using gram schmidt procedure.

collision_fft_fg(f_spec, g_spec, kn_bzm, phi, psi, phipsi)

get_new_kernel(f_bases, f_bases2, nx, ny, nz, kn_bzm, ...)

get_reduced_kernel(config, traindata, Rank)

bte.nsr.reduced_collision.orthonormalize(vectors)[source]#

Orthonormalizes the vectors using gram schmidt procedure.

Parameters:

vectors – torch tensor, size (dimension, n_vectors) they must be linearly independant

Returns:

torch tensor, size (dimension, n_vectors)

Return type:

orthonormalized_vectors

class bte.nsr.reduced_collision.Enforcer(VDIS, WDIS)[source]#

Bases: torch.nn.Module

Base class for all neural network modules.

Your models should also subclass this class.

Modules can also contain other Modules, allowing to nest them in a tree structure. You can assign the submodules as regular attributes:

import torch.nn as nn
import torch.nn.functional as F

class Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(1, 20, 5)
        self.conv2 = nn.Conv2d(20, 20, 5)

    def forward(self, x):
        x = F.relu(self.conv1(x))
        return F.relu(self.conv2(x))

Submodules assigned in this way will be registered, and will have their parameters converted too when you call to(), etc.

Note

As per the example above, an __init__() call to the parent class must be made before assignment on the child.

Variables:

training (bool) – Boolean represents whether this module is in training or evaluation mode.

forward(f)[source]#
bte.nsr.reduced_collision.collision_fft_fg(f_spec, g_spec, kn_bzm, phi, psi, phipsi)[source]#
Return type:

torch.Tensor

bte.nsr.reduced_collision.get_new_kernel(f_bases, f_bases2, nx, ny, nz, kn_bzm, phi, psi, phipsi)[source]#
class bte.nsr.reduced_collision.ReductionCollision(F, G, K, Ortho=False)[source]#

Bases: bte.dvm.collision.nn.Module

Base class for all neural network modules.

Your models should also subclass this class.

Modules can also contain other Modules, allowing to nest them in a tree structure. You can assign the submodules as regular attributes:

import torch.nn as nn
import torch.nn.functional as F

class Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(1, 20, 5)
        self.conv2 = nn.Conv2d(20, 20, 5)

    def forward(self, x):
        x = F.relu(self.conv1(x))
        return F.relu(self.conv2(x))

Submodules assigned in this way will be registered, and will have their parameters converted too when you call to(), etc.

Note

As per the example above, an __init__() call to the parent class must be made before assignment on the child.

Variables:

training (bool) – Boolean represents whether this module is in training or evaluation mode.

do_collision(f, kn_bzm=1.0)[source]#
bte.nsr.reduced_collision.get_reduced_kernel(config, traindata, Rank)[source]#