LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
example_main.cc File Reference
#include "keras_model.h"
#include <iostream>

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( )

Definition at line 17 of file example_main.cc.

References keras::KerasModel::compute_output(), keras::DataChunk::get_3d(), and keras::DataChunk::read_from_file().

Referenced by proxy::details::createCollectionProxy(), proxy::CollectionProxyBase< SpacePointWithCharge, MainColl, AuxColl... >::empty(), proxy::CollectionProxyBase< SpacePointWithCharge, MainColl, AuxColl... >::has(), proxy::details::makeCollectionProxy(), proxy::CollectionProxyBase< SpacePointWithCharge, MainColl, AuxColl... >::size(), and proxy::ChargedSpacePointsCollectionProxy< MainColl, AuxColl >::spacePoints().

18 {
19  cout << "This is simple example with Keras neural network model loading into C++.\n"
20  << "Keras model will be used in C++ for prediction only." << endl;
21 
22  DataChunk* sample = new DataChunk2D();
23  sample->read_from_file("./example/sample_mnist.dat");
24  std::cout << sample->get_3d().size() << std::endl;
25  KerasModel m("./example/dumped.nnet");
26  m.compute_output(sample);
27 
28  return 0;
29 }
virtual void read_from_file(const std::string &fname)
Definition: keras_model.h:56
virtual std::vector< std::vector< std::vector< float > > > const & get_3d() const
Definition: keras_model.h:49