parameters: (batch)
return_statement: return batch
docstring: Perform simple data augmentation on training batch
docstring_summary: Perform simple data augmentation on training batch
docstring_tokens: Perform simple data augmentation on training batch
function: def perform_augmentation(batch):
          """
          Perform simple data augmentation on training batch
          """
          def coin_flip_is_head():
              return random.choice([True, False])
  
          for b in range(batch.shape[0]):
              if coin_flip_is_head():
                  batch[b] = np.fliplr(batch[b])    # flip horizontally (mirroring)
              if coin_flip_is_head():
                  batch[b] = np.flipud(batch[b])    # flip vertically
              if coin_flip_is_head():
                  batch[b] = np.rot90(batch[b], 3)  # rotate 90 degree clockwise
              if coin_flip_is_head():
                  batch[b] = np.rot90(batch[b], 1)  # rotate 90 degree counter-clockwise
  
          return batch
function_tokens: def perform_augmentation ( batch ) : def coin_flip_is_head ( ) : return random . choice ( [ True , False ] ) for b in range ( batch . shape [ 0 ] ) : if coin_flip_is_head ( ) : batch [ b ] = np . fliplr ( batch [ b ] ) # flip horizontally (mirroring) if coin_flip_is_head ( ) : batch [ b ] = np . flipud ( batch [ b ] ) # flip vertically if coin_flip_is_head ( ) : batch [ b ] = np . rot90 ( batch [ b ] , 3 ) # rotate 90 degree clockwise if coin_flip_is_head ( ) : batch [ b ] = np . rot90 ( batch [ b ] , 1 ) # rotate 90 degree counter-clockwise return batch