13 #ifndef XACC_ALGORITHM_RBM_CLASSIFICATION_HPP_ 14 #define XACC_ALGORITHM_RBM_CLASSIFICATION_HPP_ 16 #include "Algorithm.hpp" 18 #include <Eigen/Dense> 26 virtual std::tuple<Eigen::MatrixXd, Eigen::VectorXd, Eigen::VectorXd>
27 compute(Eigen::MatrixXd &features, Eigen::MatrixXd &w, Eigen::VectorXd &v,
34 Eigen::MatrixXd training_data;
39 template <
typename M> M load_csv(
const std::string &path) {
43 std::vector<double> values;
45 while (std::getline(indata, line)) {
47 std::stringstream lineStream(line);
49 while (std::getline(lineStream, cell,
',')) {
50 values.push_back(std::stod(cell));
56 const Eigen::Matrix<
typename M::Scalar, M::RowsAtCompileTime,
57 M::ColsAtCompileTime, Eigen::RowMajor>>(
58 values.data(), rows, values.size() / rows);
63 const std::vector<std::string> requiredParameters()
const override;
65 void execute(
const std::shared_ptr<AcceleratorBuffer> buffer)
const override;
66 const std::string
name()
const override {
return "rbm-classification"; }
Definition: Algorithm.hpp:34
const std::string name() const override
Definition: rbm_classification.hpp:66
Definition: Accelerator.hpp:25
Definition: rbm_classification.hpp:24
const std::string description() const override
Definition: rbm_classification.hpp:67
Definition: heterogeneous.hpp:45
Definition: Identifiable.hpp:25
Definition: CompositeInstruction.hpp:72
Definition: rbm_classification.hpp:31