![]() |
Belle II Software light-2509-fornax
|
Public Member Functions | |
| __init__ (self, train_x, train_y, valid_x, valid_y, batch_size, seed=None, epoch_random_shuffle=True) | |
| sanitize_labels (self) | |
| batch_iterator (self) | |
Public Attributes | |
| train_x = train_x.astype(np.float32) | |
| training features | |
| int | train_y = train_y.astype(np.float32) |
| training targets | |
| valid_x = valid_x.astype(np.float32) | |
| validation features | |
| int | valid_y = valid_y.astype(np.float32) |
| validation targets | |
| batch_size = batch_size | |
| batch size | |
| seed = seed | |
| random generator seed | |
| epoch_random_shuffle = epoch_random_shuffle | |
| bool, enables shuffling | |
| train_events = self.train_x.shape[0] | |
| number of training events | |
| valid_events = self.valid_x.shape[0] | |
| number of validation events | |
| feature_number = self.train_x.shape[1] | |
| number of features | |
| batches = self.train_x.shape[0] // self.batch_size | |
| number of batches | |
| train_idx = np.zeros(self.train_x.shape[0]) | |
| indices required for shuffling | |
| batch_train_x = np.zeros((self.feature_number, self.batch_size)) | |
| np ndarray for training batch features | |
| int | batch_train_y = np.zeros(self.batch_size) |
| np ndarray for training batch of targets | |
| random_state = np.random.RandomState(seed) | |
| set random generator | |
| __init__ | ( | self, | |
| train_x, | |||
| train_y, | |||
| valid_x, | |||
| valid_y, | |||
| batch_size, | |||
| seed = None, | |||
| epoch_random_shuffle = True ) |
declaration of class variables
Definition at line 20 of file TfData.py.
| batch_iterator | ( | self | ) |
iterator to provide training batches
Definition at line 90 of file TfData.py.
| sanitize_labels | ( | self | ) |
checks for a binary classification problem
transforms the two class labels to {0,1}
Definition at line 66 of file TfData.py.
| batch_train_x = np.zeros((self.feature_number, self.batch_size)) |
| int batch_train_y = np.zeros(self.batch_size) |
| batches = self.train_x.shape[0] // self.batch_size |
| epoch_random_shuffle = epoch_random_shuffle |
| random_state = np.random.RandomState(seed) |
| train_events = self.train_x.shape[0] |
| train_idx = np.zeros(self.train_x.shape[0]) |
| valid_events = self.valid_x.shape[0] |