43 const std::vector<TMatrixT<Double_t>> &linputTensor = std::get<0>(
fData);
47 size_t sampleIndex = *sampleIterator;
49 tensor[0](i, j) =
static_cast<Real_t>(linputTensor[0](sampleIndex, j));
55 size_t sampleIndex = *sampleIterator;
58 tensor[i](j, k) =
static_cast<Real_t>(linputTensor[sampleIndex](j, k));
75 size_t sampleIndex = *sampleIterator;
76 for (
size_t j = 0; j <
n; j++) {
77 matrix(i, j) =
static_cast<Real_t>(loutputMatrix(sampleIndex, j));
92 size_t sampleIndex = *sampleIterator;
93 matrix(i, 0) =
static_cast<Real_t>(lweightMatrix(sampleIndex, 0));
103 const std::vector<TMatrixT<Double_t>> &linputTensor = std::get<0>(
fData);
107 size_t sampleIndex = *sampleIterator;
109 tensor[0](i, j) = linputTensor[0](sampleIndex, j);
115 size_t sampleIndex = *sampleIterator;
118 tensor[i](j, k) = linputTensor[sampleIndex](j, k);
135 size_t sampleIndex = *sampleIterator;
136 for (
size_t j = 0; j <
n; j++) {
137 matrix(i, j) = loutputMatrix(sampleIndex, j);
152 size_t sampleIndex = *sampleIterator;
153 matrix(i, 0) = lweightMatrix(sampleIndex, 0);
168 size_t sampleIndex = *sampleIterator;
170 event = std::get<0>(
fData)[sampleIndex];
171 tensor[0](i, j) =
static_cast<Real_t>(event->GetValue(j));
177 size_t sampleIndex = *sampleIterator;
180 event = std::get<0>(
fData)[sampleIndex];
198 size_t sampleIndex = *sampleIterator++;
199 Event *
event = std::get<0>(
fData)[sampleIndex];
201 for (
Int_t j = 0; j <
n; j++) {
202 if (event->GetNTargets() == 0) {
204 matrix(i, j) = (info.
IsSignal(event)) ? 1.0 : 0.0;
207 if (j == (
Int_t)event->GetClass()) {
212 matrix(i, j) =
static_cast<Real_t>(
event->GetTarget(j));
224 size_t sampleIndex = *sampleIterator++;
225 Event *
event = std::get<0>(
fData)[sampleIndex];
226 matrix(i, 0) =
static_cast<Real_t>(
event->GetWeight());
240 size_t sampleIndex = *sampleIterator;
242 event = std::get<0>(
fData)[sampleIndex];
243 tensor[0](i, j) = event->GetValue(j);
249 size_t sampleIndex = *sampleIterator;
252 event = std::get<0>(
fData)[sampleIndex];
253 tensor[i](j, k) = event->GetValue(j *
fBatchWidth + k);
270 size_t sampleIndex = *sampleIterator++;
271 Event *
event = std::get<0>(
fData)[sampleIndex];
273 for (
Int_t j = 0; j <
n; j++) {
274 if (event->GetNTargets() == 0) {
276 matrix(i, j) = (info.
IsSignal(event)) ? 1.0 : 0.0;
279 if (j == (
Int_t)event->GetClass()) {
284 matrix(i, j) =
event->GetTarget(j);
296 size_t sampleIndex = *sampleIterator++;
297 Event *
event = std::get<0>(
fData)[sampleIndex];
298 matrix(i, 0) =
event->GetWeight();
int Int_t
Signed integer 4 bytes (int).
float Real_t
TVector and TMatrix element type (float).
TTensorDataLoader(const AData &data, size_t nSamples, size_t batchDepth, size_t batchHeight, size_t batchWidth, size_t nOutputFeatures, std::vector< size_t > inputShape, size_t nStreams=1)
Constructor.
size_t fBatchHeight
The number od rows in each matrix.
const AData & fData
The data that should be loaded in the batches.
std::vector< size_t > fInputShape
Defines the batch depth, no. of channels and spatial dimensions of an input tensor.
void CopyTensorInput(std::vector< TMatrixT< AReal > > &tensor, IndexIterator_t sampleIterator)
Copy input tensor into the given host buffer.
size_t fBatchDepth
The number of matrices in the tensor.
size_t fBatchWidth
The number of columns in each matrix.
void CopyTensorWeights(TMatrixT< AReal > &matrix, IndexIterator_t sampleIterator)
Copy weight matrix into the given host buffer.
void CopyTensorOutput(TMatrixT< AReal > &matrix, IndexIterator_t sampleIterator)
Copy output matrix into the given host buffer.
Class that contains all the data information.
Bool_t IsSignal(const Event *ev) const
typename std::vector< size_t >::iterator IndexIterator_t
create variable transformations