ATLAS Offline Software
Loading...
Searching...
No Matches
FastInputPreprocessor.h
Go to the documentation of this file.
1// this is -*- C++ -*-
2/*
3 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4*/
5
6// Any modifications to this file may be copied to lwtnn[1] without
7// attribution.
8//
9// [1]: https::www.github.com/lwtnn/lwtnn
10
11
12#ifndef LWTNN_UTILS_FAST_INPUT_PREPROCESSOR_H
13#define LWTNN_UTILS_FAST_INPUT_PREPROCESSOR_H
14
15#include "lwtnn/lightweight_network_config.hh"
16#include "lwtnn/Exceptions.hh"
17
20
21#include <Eigen/Dense>
22#include <vector>
23
24namespace lwt::atlas {
25
26 using Eigen::VectorXd;
27 using Eigen::MatrixXd;
28
29 // ______________________________________________________________________
30 // input preprocessor (handles normalization and packing into Eigen)
31
33 {
34 public:
35 FastInputPreprocessor(const std::vector<Input>& inputs,
36 const std::vector<std::string>& order);
37 VectorXd operator()(const VectorXd&) const;
38 private:
39 // input transformations
40 VectorXd m_offsets;
41 VectorXd m_scales;
42 std::vector<size_t> m_indices;
43 };
44
46 {
47 public:
48 FastInputVectorPreprocessor(const std::vector<Input>& inputs,
49 const std::vector<std::string>& order);
50 MatrixXd operator()(const MatrixXd&) const;
51 private:
52 // input transformations
53 VectorXd m_offsets;
54 VectorXd m_scales;
55 std::vector<size_t> m_indices;
56 };
57}
58
59
60#endif
FastInputPreprocessor(const std::vector< Input > &inputs, const std::vector< std::string > &order)
VectorXd operator()(const VectorXd &) const
MatrixXd operator()(const MatrixXd &) const
FastInputVectorPreprocessor(const std::vector< Input > &inputs, const std::vector< std::string > &order)
Ensure that the extensions for the Vector3D are properly loaded.