mlreco.utils.utils module¶
-
mlreco.utils.utils.progress_bar(count, total, message='')[source]¶ - Args: count …. int/float, current progress counter
total …. int/float, total counter message .. string, appended after the progress bar
-
class
mlreco.utils.utils.stopwatch[source]¶ Bases:
objectSimple stopwatch class to organize various time measurement. Not very precise but good enough for a millisecond level precision
-
start(key)[source]¶ Starts a stopwatch for a unique key INPUT
key can be any object but typically a string to tag a time measurement
-
stop(key)[source]¶ Stops a stopwatch for a unique key INPUT
key can be any object but typically a string to tag a time measurement
-
time(key)[source]¶ Returns the time recorded or past so far (if not stopped) INPUT
key can be any object but typically a string to tag a time measurement
-
__dict__= mappingproxy({'__module__': 'mlreco.utils.utils', '__doc__': '\n Simple stopwatch class to organize various time measurement.\n Not very precise but good enough for a millisecond level precision\n ', '__init__': <function stopwatch.__init__>, 'start': <function stopwatch.start>, 'stop': <function stopwatch.stop>, 'start_cputime': <function stopwatch.start_cputime>, 'stop_cputime': <function stopwatch.stop_cputime>, 'time_cputime': <function stopwatch.time_cputime>, 'time': <function stopwatch.time>, '__dict__': <attribute '__dict__' of 'stopwatch' objects>, '__weakref__': <attribute '__weakref__' of 'stopwatch' objects>, '__annotations__': {}})¶
-
__module__= 'mlreco.utils.utils'¶
-
__weakref__¶ list of weak references to the object (if defined)
-
-
class
mlreco.utils.utils.ForwardData[source]¶ Bases:
objectUtility class for computing averages of loss and accuracies.
-
__dict__= mappingproxy({'__module__': 'mlreco.utils.utils', '__doc__': '\n Utility class for computing averages of loss and accuracies.\n ', '__init__': <function ForwardData.__init__>, '__getitem__': <function ForwardData.__getitem__>, 'update_mean': <function ForwardData.update_mean>, 'update_dict': <function ForwardData.update_dict>, 'as_dict': <function ForwardData.as_dict>, '__repr__': <function ForwardData.__repr__>, '__dict__': <attribute '__dict__' of 'ForwardData' objects>, '__weakref__': <attribute '__weakref__' of 'ForwardData' objects>, '__annotations__': {}})¶
-
__module__= 'mlreco.utils.utils'¶
-
__weakref__¶ list of weak references to the object (if defined)
-
-
class
mlreco.utils.utils.CSVData(fout, append=False)[source]¶ Bases:
object-
__dict__= mappingproxy({'__module__': 'mlreco.utils.utils', '__init__': <function CSVData.__init__>, 'record': <function CSVData.record>, 'write': <function CSVData.write>, 'flush': <function CSVData.flush>, 'close': <function CSVData.close>, '__dict__': <attribute '__dict__' of 'CSVData' objects>, '__weakref__': <attribute '__weakref__' of 'CSVData' objects>, '__doc__': None, '__annotations__': {}})¶
-
__module__= 'mlreco.utils.utils'¶
-
__weakref__¶ list of weak references to the object (if defined)
-
-
class
mlreco.utils.utils.ChunkCSVData(fout, append=True, chunksize=1000)[source]¶ Bases:
object-
__init__(fout, append=True, chunksize=1000)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
__dict__= mappingproxy({'__module__': 'mlreco.utils.utils', '__init__': <function ChunkCSVData.__init__>, 'record': <function ChunkCSVData.record>, '__dict__': <attribute '__dict__' of 'ChunkCSVData' objects>, '__weakref__': <attribute '__weakref__' of 'ChunkCSVData' objects>, '__doc__': None, '__annotations__': {}})¶
-
__module__= 'mlreco.utils.utils'¶
-
__weakref__¶ list of weak references to the object (if defined)
-