25 return UMBridgeModPiece::EigenvectoriToStdVector(
modPiece->inputSizes);
29 return UMBridgeModPiece::EigenvectoriToStdVector(
modPiece->outputSizes);
32 std::vector<std::vector<double>>
Evaluate(
const std::vector<std::vector<double>>& inputs,
json config)
override {
33 return UMBridgeModPiece::EigenvectordsToStdVectors(
37 std::vector<double>
Gradient(
unsigned int outWrt,
39 const std::vector<std::vector<double>>& inputs,
40 const std::vector<double>& sens,
42 return UMBridgeModPiece::EigenvectordToStdVector(
51 const std::vector<std::vector<double>>& inputs,
52 const std::vector<double>& vec,
54 return UMBridgeModPiece::EigenvectordToStdVector(
64 const std::vector<std::vector<double>>& inputs,
65 const std::vector<double>& sens,
66 const std::vector<double>& vec,
68 return UMBridgeModPiece::EigenvectordToStdVector(
83 std::shared_ptr<muq::Modeling::ModPiece>
modPiece;
93 void serveModPiece(std::shared_ptr<ModPiece> modPiece, std::string name, std::string host,
int port) {
Wrap a ModPiece in an UM-Bridge Model.
bool SupportsApplyHessian() override
std::vector< double > ApplyHessian(unsigned int outWrt, unsigned int inWrt1, unsigned int inWrt2, const std::vector< std::vector< double >> &inputs, const std::vector< double > &sens, const std::vector< double > &vec, json config=json()) override
bool SupportsApplyJacobian() override
std::vector< double > Gradient(unsigned int outWrt, unsigned int inWrt, const std::vector< std::vector< double >> &inputs, const std::vector< double > &sens, json config=json()) override
UMBridgeModPieceWrapper(std::shared_ptr< muq::Modeling::ModPiece > modPiece, std::string name)
Constructor.
std::vector< std::size_t > GetInputSizes(const json &config_json=json()) const override
std::vector< std::size_t > GetOutputSizes(const json &config_json=json()) const override
std::vector< std::vector< double > > Evaluate(const std::vector< std::vector< double >> &inputs, json config) override
std::shared_ptr< muq::Modeling::ModPiece > modPiece
bool SupportsGradient() override
bool SupportsEvaluate() override
std::vector< double > ApplyJacobian(unsigned int outWrt, unsigned int inWrt, const std::vector< std::vector< double >> &inputs, const std::vector< double > &vec, json config=json()) override
static Eigen::VectorXd StdVectorToEigenvectord(std::vector< double > &vector)
static std::vector< Eigen::VectorXd > StdVectorsToEigenvectords(std::vector< std::vector< double >> vector)
a class to store JSON values
void serveModPiece(std::shared_ptr< ModPiece > modPiece, std::string name, std::string host, int port)
Serve a ModPiece via network using UM-Bridge.
void serveModels(std::vector< Model * > models, std::string host, int port)