|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "lwtnn/LightweightNeuralNetwork.hh"
13 #include "lwtnn/parse_json.hh"
27 ATH_MSG_DEBUG(
"Making new m_lwtnn_neural for copy of network.");
28 std::stringstream json_stream(
m_json);
37 ATH_MSG_DEBUG(
"Reading the m_json string stream into a neural network");
38 std::stringstream json_stream(
m_json);
44 for (
const std::string&
name :
config.outputs) {
66 <<
" An LWTNN neural network can only handle one node.");
68 std::map<std::string, double> flat_inputs;
70 flat_inputs =
node.second;
76 ATH_MSG_DEBUG(
"Computation on LWTNN neural network done, returning");
81 void TFCSSimpleLWTNNHandler::Streamer(TBuffer &buf) {
83 if (buf.IsReading()) {
86 TFCSSimpleLWTNNHandler::Class()->ReadBuffer(buf,
this);
90 #ifndef __FastCaloSimStandAlone__
100 "Writing buffer in TFCSSimpleLWTNNHandler, but m_json is empty.");
103 TFCSSimpleLWTNNHandler::Class()->WriteBuffer(buf,
this);
std::map< std::string, double > NetworkOutputs
Format for network outputs.
void setupNet() override
Perform actions that prepare network for use.
std::unique_ptr< lwt::LightweightNeuralNetwork > m_lwtnn_neural
The network that we are wrapping here.
static std::string representNetworkOutputs(NetworkOutputs const &outputs, int maxValues=3)
String representation of network outputs.
std::map< std::string, std::map< std::string, double > > NetworkInputs
Format for network inputs.
NetworkOutputs compute(NetworkInputs const &inputs) const override
Function to pass values to the network.
std::string m_json
String containing json input file.
std::vector< std::string > m_outputLayers
Do not persistify.
#define ATH_MSG_VERBOSE(x)
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
JSONConfig parse_json(std::istream &json)
void deleteAllButNet() override
Get rid of any memory objects that arn't needed to run the net.
TFCSSimpleLWTNNHandler(const std::string &inputFile)
TFCSSimpleLWTNNHandler constructor.
void removePrefixes(NetworkOutputs &outputs) const
Remove any common prefix from the outputs.
std::vector< std::string > getOutputLayers() const override
List the names of the outputs.
static std::string representNetworkInputs(NetworkInputs const &inputs, int maxValues=3)
String representation of network inputs.
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
#define ATH_MSG_WARNING(x)
void setupPersistedVariables() override
Perform actions that prep data to create the net.