Add Proposal class

This commit is contained in:
2023-08-04 13:05:12 +02:00
parent 45c1d052ac
commit c568ba111d
2 changed files with 100 additions and 0 deletions

25
src/BayesNet/Proposal.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef PROPOSAL_H
#define PROPOSAL_H
#include <string>
#include <map>
#include <torch/torch.h>
#include "Network.h"
#include "CPPFImdlp.h"
namespace bayesnet {
class Proposal {
public:
Proposal(vector<vector<int>>& Xv_, vector<int>& yv_);
virtual ~Proposal() = default;
protected:
void localDiscretizationProposal(Network& model, vector<string>& features, string className, map<string, vector<int>>& states);
void fit_local_discretization(vector<string>& features, string className, map<string, vector<int>>& states, torch::Tensor& y);
torch::Tensor Xf; // X continuous nxm tensor
map<string, mdlp::CPPFImdlp*> discretizers;
private:
vector<vector<int>>& Xv; // X discrete nxm vector
vector<int>& yv;
};
}
#endif