BayesNet 1.0.7.
Bayesian Network and basic classifiers Library.
Loading...
Searching...
No Matches
KDB.h
1// ***************************************************************
2// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez
3// SPDX-FileType: SOURCE
4// SPDX-License-Identifier: MIT
5// ***************************************************************
6
7#ifndef KDB_H
8#define KDB_H
9#include <torch/torch.h>
10#include "Classifier.h"
11namespace bayesnet {
12 class KDB : public Classifier {
13 private:
14 int k;
15 float theta;
16 protected:
17 void add_m_edges(int idx, std::vector<int>& S, torch::Tensor& weights);
18 void buildModel(const torch::Tensor& weights) override;
19 public:
20 explicit KDB(int k, float theta = 0.03);
21 virtual ~KDB() = default;
22 void setHyperparameters(const nlohmann::json& hyperparameters_) override;
23 std::vector<std::string> graph(const std::string& name = "KDB") const override;
24 };
25}
26#endif