pub struct QuadraticProgrammingLayer {
pub n_vars: usize,
pub n_eq: usize,
pub n_ineq: usize,
}Expand description
Quadratic programming layer: min 0.5 x^T Q x + c^T x s.t. Ax = b, Gx ≤ h
Fields§
§n_vars: usizeProblem dimension
n_eq: usizeNumber of equality constraints
n_ineq: usizeNumber of inequality constraints
Implementations§
Trait Implementations§
Source§impl DifferentiableOptimization for QuadraticProgrammingLayer
impl DifferentiableOptimization for QuadraticProgrammingLayer
Source§fn solve(
&self,
parameters: &[&Tensor],
config: &OptimizationConfig,
) -> Result<OptimizationSolution>
fn solve( &self, parameters: &[&Tensor], config: &OptimizationConfig, ) -> Result<OptimizationSolution>
Solve the optimization problem
Source§fn differentiate(
&self,
solution: &OptimizationSolution,
parameters: &[&Tensor],
downstream_grad: &Tensor,
config: &OptimizationConfig,
) -> Result<Vec<Tensor>>
fn differentiate( &self, solution: &OptimizationSolution, parameters: &[&Tensor], downstream_grad: &Tensor, config: &OptimizationConfig, ) -> Result<Vec<Tensor>>
Compute derivatives of the solution w.r.t. parameters
Source§fn problem_type(&self) -> OptimizationProblem
fn problem_type(&self) -> OptimizationProblem
Get the type of optimization problem
Auto Trait Implementations§
impl Freeze for QuadraticProgrammingLayer
impl RefUnwindSafe for QuadraticProgrammingLayer
impl Send for QuadraticProgrammingLayer
impl Sync for QuadraticProgrammingLayer
impl Unpin for QuadraticProgrammingLayer
impl UnsafeUnpin for QuadraticProgrammingLayer
impl UnwindSafe for QuadraticProgrammingLayer
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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