- class flamo.auxiliary.minimize.MLS(G: Tensor, target_interp: Tensor)
Mean Least Squares module. Computes the mean of the squares of the residuals, computed as
\[\frac{1}{n} \sum_{i=1}^{n} (Gx_i - y_i)^2\]where \(G\) is the matrix to be multiplied with the input, \(x_i\) is the input, and \(y_i\) is the target tensor.
- Arguments:
G (torch.Tensor): The matrix to be multiplied with the input.
target_interp (torch.Tensor): The target interpolation tensor.
- forward(x)
Computes the mean least squares loss.
- flamo.auxiliary.minimize.minimize_LBFGS(G: Tensor, target_interp: Tensor, lower_bound: Tensor, upper_bound: Tensor, num_freq: int, max_iter: int = 100)
Minimize the mean least square (MLS) loss using the LBFGS optimizer.
- Arguments:
G (torch.Tensor): The matrix to be multiplied with the input.
target_interp (torch.Tensor): The target interpolation tensor.
lower_bound (torch.Tensor): Lower bound for the optimization variables.
upper_bound (torch.Tensor): Upper bound for the optimization variables.
num_freq (int): Number of frequencies.
max_iter (int, optional): Maximum number of iterations. Default is 100.
- Returns:
torch.nn.Parameter: The optimized result.