Belle II Software development
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
 Spectators.
 
 len
 Number of events.
 
 index_array
 Index array, which will be shuffled.
 
 pointer
 Pointer for index array.
 

Detailed Description

Class to create batches for training the Adversary Network.
See mva/examples/keras/adversary_network.py for details.

Definition at line 54 of file B2A714-DeepContinuumSuppression_MVAModel.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 60 of file B2A714-DeepContinuumSuppression_MVAModel.py.

60 def __init__(self, X, Y, Z):
61 """
62 Init the class
63 :param X: Input Features
64 :param Y: Label Data
65 :param Z: Spectaters/Qunatity to be uncorrelated to
66 """
67
68 self.X = X
69
70 self.Y = Y
71
72 self.Z = Z
73
74 self.len = len(Y)
75
76 self.index_array = np.arange(self.len)
77 np.random.shuffle(self.index_array)
78
79 self.pointer = 0
80

Member Function Documentation

◆ next_batch()

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

Definition at line 81 of file B2A714-DeepContinuumSuppression_MVAModel.py.

81 def next_batch(self, batch_size):
82 """
83 Getting next batch of training data
84 """
85 if self.pointer + batch_size >= self.len:
86 np.random.shuffle(self.index_array)
87 self.pointer = 0
88
89 batch_index = self.index_array[self.pointer:self.pointer + batch_size]
90 self.pointer += batch_size
91
92 return self.X[batch_index], self.Y[batch_index], self.Z[batch_index]
93
94

Member Data Documentation

◆ index_array

index_array

Index array, which will be shuffled.

Definition at line 76 of file B2A714-DeepContinuumSuppression_MVAModel.py.

◆ len

len

Number of events.

Definition at line 74 of file B2A714-DeepContinuumSuppression_MVAModel.py.

◆ pointer

pointer

Pointer for index array.

Definition at line 79 of file B2A714-DeepContinuumSuppression_MVAModel.py.

◆ X

X

Input Features.

Definition at line 68 of file B2A714-DeepContinuumSuppression_MVAModel.py.

◆ Y

Y

Label Data.

Definition at line 70 of file B2A714-DeepContinuumSuppression_MVAModel.py.

◆ Z

Z

Spectators.

Definition at line 72 of file B2A714-DeepContinuumSuppression_MVAModel.py.


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