unsafe fn convert(&self) -> Result<sbr::models::ewma::Hyperparameters, const_cstr::ConstCStr> {
        let optimizer = match self.optimizer {
            Optimizer::Adam => Ok(sbr::models::Optimizer::Adam),
            Optimizer::Adagrad => Ok(sbr::models::Optimizer::Adagrad),
        }?;

        let loss = match self.loss {
            Loss::BPR => Ok(sbr::models::Loss::BPR),
            Loss::Hinge => Ok(sbr::models::Loss::Hinge),
            Loss::WARP => Ok(sbr::models::Loss::WARP),
        }?;

        Ok(
            sbr::models::ewma::Hyperparameters::new(self.num_items, self.max_sequence_length)
                .learning_rate(self.learning_rate)
                .embedding_dim(self.item_embedding_dim)
                .l2_penalty(self.l2_penalty)
                .num_epochs(self.num_epochs)
                .num_threads(self.num_threads)
                .parallelism(sbr::models::Parallelism::Synchronous)
                .optimizer(optimizer)
                .loss(loss)
                .from_seed(self.random_seed),
        )
    }
/// Convert to the actual hyperparameters object.
Convert to the actual hyperparameters object.
Convert to the actual hyperparameters object .
unsafe fn convert(&self) -> Result<sbr::models::ewma::Hyperparameters, const_cstr::ConstCStr> {
        let optimizer = match self.optimizer {
            Optimizer::Adam => Ok(sbr::models::Optimizer::Adam),
            Optimizer::Adagrad => Ok(sbr::models::Optimizer::Adagrad),
        }?;
        let loss = match self.loss {
            Loss::BPR => Ok(sbr::models::Loss::BPR),
            Loss::Hinge => Ok(sbr::models::Loss::Hinge),
            Loss::WARP => Ok(sbr::models::Loss::WARP),
        }?;
        Ok(
            sbr::models::ewma::Hyperparameters::new(self.num_items, self.max_sequence_length)
                .learning_rate(self.learning_rate)
                .embedding_dim(self.item_embedding_dim)
                .l2_penalty(self.l2_penalty)
                .num_epochs(self.num_epochs)
                .num_threads(self.num_threads)
                .parallelism(sbr::models::Parallelism::Synchronous)
                .optimizer(optimizer)
                .loss(loss)
                .from_seed(self.random_seed),
        )
    }
unsafe fn convert ( & self ) -> Result < sbr :: models :: ewma :: Hyperparameters , const_cstr :: ConstCStr > { let optimizer = match self . optimizer { Optimizer :: Adam => Ok ( sbr :: models :: Optimizer :: Adam ) , Optimizer :: Adagrad => Ok ( sbr :: models :: Optimizer :: Adagrad ) , } ? ; let loss = match self . loss { Loss :: BPR => Ok ( sbr :: models :: Loss :: BPR ) , Loss :: Hinge => Ok ( sbr :: models :: Loss :: Hinge ) , Loss :: WARP => Ok ( sbr :: models :: Loss :: WARP ) , } ? ; Ok ( sbr :: models :: ewma :: Hyperparameters :: new ( self . num_items , self . max_sequence_length ) . learning_rate ( self . learning_rate ) . embedding_dim ( self . item_embedding_dim ) . l2_penalty ( self . l2_penalty ) . num_epochs ( self . num_epochs ) . num_threads ( self . num_threads ) . parallelism ( sbr :: models :: Parallelism :: Synchronous ) . optimizer ( optimizer ) . loss ( loss ) . from_seed ( self . random_seed ) , ) }
Convert to the actual hyperparameters object.
Convert to the actual hyperparameters object .
&self