VNetworkLWTNN class

A template defining the interface to a lwtnn network.

Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration

Abstract base class for LWTNN Neural networks. Inherits from a generic abstract network class, and defined aspects common to all LWTNN networks.

In particular, this derived virtual class handles saving, memory management and printing.

To classes derive from this class;

Base classes

class VNetworkBase
A template defining the interface to a neural network.

Derived classes

class TFCSGANLWTNNHandler
class TFCSSimpleLWTNNHandler

Constructors, destructors, conversion operators

VNetworkLWTNN(const VNetworkLWTNN& copy_from)
VNetworkLWTNN copy constructor.
~VNetworkLWTNN() virtual
VNetworkBase()
VNetworkBase default constructor.
VNetworkBase() explicit
VNetworkBase constructor.
VNetworkBase()
VNetworkBase copy constructor.

Public functions

void writeNetToTTree(TTree& tree) override
Save the network to a TTree.
void deleteAllButNet() override
Get rid of any memory objects that aren't needed to run the net.
void writeNetToTTree() pure virtual
Save the network to a TTree.
void writeNetToTTree()
Save the network to a TTree.
void writeNetToTTree()
Save the network to a TTree.

Protected functions

void print(std::ostream& strm) const override
Write a short description of this net to the string stream.
void setupPersistedVariables() override
Perform actions that prep data to create the net.

Protected variables

std::string m_json
String containing json input file.

Function documentation

VNetworkLWTNN::VNetworkLWTNN(const VNetworkLWTNN& copy_from)

VNetworkLWTNN copy constructor.

Parameters
copy_from existing network that we are copying

Will copy the variables that would be generated by setupPersistedVariables and setupNet. Will fail if deleteAllButNet has already been called.

VNetworkLWTNN::VNetworkBase()

VNetworkBase default constructor.

For use in streamers.

VNetworkLWTNN::VNetworkBase() explicit

VNetworkBase constructor.

Only saves inputFile to m_inputFile; Inheriting classes should call setupPersistedVariables and setupNet in constructor;

VNetworkLWTNN::VNetworkBase()

VNetworkBase copy constructor.

Does not call setupPersistedVariables or setupNet but will pass on m_inputFile. Inheriting classes should do whatever they need to move the variables created in the setup functions.

void VNetworkLWTNN::writeNetToTTree(TTree& tree) override

Save the network to a TTree.

Parameters
tree The tree to save inside.

All data required to recreate the network object is saved into a TTree. The format is not specified.

void VNetworkLWTNN::deleteAllButNet() override

Get rid of any memory objects that aren't needed to run the net.

Minimize memory usage by deleting nay inputs that are no longer required to run the compute function. Will prevent the net from being saved, if you need to call writeNetToTTree that must happen before this is called.

void VNetworkLWTNN::writeNetToTTree() pure virtual

Save the network to a TTree.

All data required to recreate the network object is saved into a TTree. The format is not specified.

void VNetworkLWTNN::writeNetToTTree()

Save the network to a TTree.

All data required to recreate the network object is saved into a TTree. The format is not specified.

void VNetworkLWTNN::writeNetToTTree()

Save the network to a TTree.

All data required to recreate the network object is saved into a TTree. The format is not specified.

void VNetworkLWTNN::print(std::ostream& strm) const override protected

Write a short description of this net to the string stream.

Parameters
strm output parameter, to which the description will be written.

Outputs a printable name, which maybe a file name, or a note specifying that the file has been provided from memory.

void VNetworkLWTNN::setupPersistedVariables() override protected

Perform actions that prep data to create the net.

Will be called in the base class constructor before calling setupNet, but not in the streamer. It sets any variables that the sreamer would persist when saving or loading to file.

Variable documentation

std::string VNetworkLWTNN::m_json protected

String containing json input file.

Is needed to save the network with writeNetToTTree but not needed to run the network with compute. Is eraised by deleteAllButNet Should be persisted.