tiny-solver 0.13.0

Factor graph solver
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use pyo3::prelude::*;

use crate::loss_functions::*;

#[pyclass(name = "HuberLoss")]
#[derive(Clone)]
pub struct PyHuberLoss(pub HuberLoss);

#[pymethods]
impl PyHuberLoss {
    #[new]
    #[pyo3(signature=(scale=1.0))]
    pub fn new_py(scale: f64) -> Self {
        PyHuberLoss(HuberLoss::new(scale))
    }
}