Files
BayesNet/docs/manual/_proposal_8h_source.html

11 KiB

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="clipboard.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="cookie.js"></script> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> </head>
BayesNet 1.0.5
Bayesian Network Classifiers using libtorch from scratch
<script type="text/javascript"> /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ var searchBox = new SearchBox("searchBox", "search/",'.html'); /* @license-end */ </script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ $(function() { codefold.init(0); }); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ $(function() { initMenu('',true,false,'search.php','Search',true); $(function() { init_search(); }); }); /* @license-end */ </script>
<script type="text/javascript"> /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ $(function(){initNavTree('_proposal_8h_source.html',''); initResizable(true); }); /* @license-end */ </script>
Loading...
Searching...
No Matches
Proposal.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 PROPOSAL_H
8#define PROPOSAL_H
9#include <string>
10#include <map>
11#include <torch/torch.h>
12#include <CPPFImdlp.h>
13#include "bayesnet/network/Network.h"
14#include "Classifier.h"
15
16namespace bayesnet {
17 class Proposal {
18 public:
19 Proposal(torch::Tensor& pDataset, std::vector<std::string>& features_, std::string& className_);
20 virtual ~Proposal();
21 protected:
22 void checkInput(const torch::Tensor& X, const torch::Tensor& y);
23 torch::Tensor prepareX(torch::Tensor& X);
24 map<std::string, std::vector<int>> localDiscretizationProposal(const map<std::string, std::vector<int>>& states, Network& model);
25 map<std::string, std::vector<int>> fit_local_discretization(const torch::Tensor& y);
26 torch::Tensor Xf; // X continuous nxm tensor
27 torch::Tensor y; // y discrete nx1 tensor
28 map<std::string, mdlp::CPPFImdlp*> discretizers;
29 private:
30 std::vector<int> factorize(const std::vector<std::string>& labels_t);
31 torch::Tensor& pDataset; // (n+1)xm tensor
32 std::vector<std::string>& pFeatures;
33 std::string& pClassName;
34 };
35}
36
37#endif
</html>