#NEWLINE# def apply( self , dataset , can_fit = False ) : #NEWLINE# #INDENT# '\n        .. todo::\n\n            WRITEME\n        ' #NEWLINE# axes = [ 'b' , 0 , 1 , 'c' ] #NEWLINE# data_size = dataset . X . shape [ 0 ] #NEWLINE# if ( self . _channels is None ) : #NEWLINE# #INDENT# self . _channels #NEWLINE# #UNINDENT# last = ( numpy . floor ( ( data_size / float ( self . _batch_size ) ) ) * self . _batch_size ) #NEWLINE# for i in xrange ( 0 , data_size , self . _batch_size ) : #NEWLINE# #INDENT# stop = ( ( i + numpy . mod ( data_size , self . _batch_size ) ) if ( i >= last ) else ( i + self . _batch_size ) ) #NEWLINE# log . info ( 'LCN processing data from {0} to {1}' . format ( i , stop ) ) #NEWLINE# transformed = self . transform ( convert_axes ( dataset . get_topological_view ( dataset . X [ i : stop , : ] ) , dataset . view_converter . axes , axes ) ) #NEWLINE# transformed = convert_axes ( transformed , axes , dataset . view_converter . axes ) #NEWLINE# if ( self . _batch_size != data_size ) : #NEWLINE# #INDENT# if isinstance ( dataset . X , numpy . ndarray ) : #NEWLINE# #INDENT# transformed = convert_axes ( transformed , dataset . view_converter . axes , [ 'b' , 0 , 1 , 'c' ] ) #NEWLINE# transformed = transformed . reshape ( transformed . shape [ 0 ] , ( ( transformed . shape [ 1 ] * transformed . shape [ 2 ] ) * transformed . shape [ 3 ] ) ) #NEWLINE# dataset . X [ i : stop ] = transformed #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dataset . set_topological_view ( transformed , dataset . view_converter . axes , start = i ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( self . _batch_size == data_size ) : #NEWLINE# #INDENT# dataset . set_topological_view ( transformed , dataset . view_converter . axes )