Belle II Software light-2406-ragdoll
batch_generator Class Reference

Public Member Functions

def __init__ (self, X, Y, Z)
 
def next_batch (self, batch_size)
 

Public Attributes

 X
 Input Features.
 
 Y
 Label data.
 
 Z
 Spectatirs/Quantity to be uncorrelated to.
 
 len
 Length of the data.
 
 index_array
 Index array containing indices from 0 to len.
 
 pointer
 Pointer to the current start of the batch.
 

Detailed Description

Class to create batches for training the Adversary Network.
Once the steps_per_epoch argument is available for the fit function in keras, this class will become obsolete.

Definition at line 35 of file adversary_network.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  X,
  Y,
  Z 
)
Init the class
:param X: Input Features
:param Y: Label Data
:param Z: Spectators/Quantity to be uncorrelated to

Definition at line 41 of file adversary_network.py.

41 def __init__(self, X, Y, Z):
42 """
43 Init the class
44 :param X: Input Features
45 :param Y: Label Data
46 :param Z: Spectators/Quantity to be uncorrelated to
47 """
48
49 self.X = X
50
51 self.Y = Y
52
53 self.Z = Z
54
55 self.len = len(Y)
56
57 self.index_array = np.arange(self.len)
58
59 self.pointer = 0
60

Member Function Documentation

◆ next_batch()

def next_batch (   self,
  batch_size 
)
Getting next batch of training data

Definition at line 61 of file adversary_network.py.

61 def next_batch(self, batch_size):
62 """
63 Getting next batch of training data
64 """
65 if self.pointer + batch_size >= self.len:
66 np.random.shuffle(self.index_array)
67 self.pointer = 0
68
69 batch_index = self.index_array[self.pointer:self.pointer + batch_size]
70 self.pointer += batch_size
71
72 return self.X[batch_index], self.Y[batch_index], self.Z[batch_index]
73
74

Member Data Documentation

◆ index_array

index_array

Index array containing indices from 0 to len.

Definition at line 57 of file adversary_network.py.

◆ len

len

Length of the data.

Definition at line 55 of file adversary_network.py.

◆ pointer

pointer

Pointer to the current start of the batch.

Definition at line 59 of file adversary_network.py.

◆ X

X

Input Features.

Definition at line 49 of file adversary_network.py.

◆ Y

Y

Label data.

Definition at line 51 of file adversary_network.py.

◆ Z

Z

Spectatirs/Quantity to be uncorrelated to.

Definition at line 53 of file adversary_network.py.


The documentation for this class was generated from the following file: