profilers module

This package is not supposed to be used by the end user though. These are just helpful modules used by k1lib.callbacks.profiler

Documenting everything here is kinda awkward, as just using it, you’ll get a better idea of what’s happening. If you want to dive deeper, then by all means, check out the source codes

computation module

class k1lib.callbacks.profilers.computation.ComputationProfiler(profiler: Profiler)[source]

Bases: k1lib.callbacks.callbacks.Callback

Profiles computation. Only provide reports on well known layers only, and thus can’t really be universal

property tpAvailable

Whether TimeProfiler’s results are available

run()[source]

Runs everything

css(css: str)[source]

Selects a small part of the network to highlight

io module

class k1lib.callbacks.profilers.io.IOProfiler[source]

Bases: k1lib.callbacks.callbacks.Callback

Gets input and output shapes of each layer

run()[source]

Runs everything

css(css: str)[source]

Selects a small part of the network to highlight

memory module

class k1lib.callbacks.profilers.memory.MemoryProfiler[source]

Bases: k1lib.callbacks.callbacks.Callback

Expected to be run only once only. If a new report for a new network architecture is required, then create a new one. Example:

l = k1lib.Learner.sample()
l.cbs.withProfiler()
# views graph and table
l.Profiler.memory
# views graph and table with selected modules highlighted
l.Profiler.memory.css("Linear")
run()[source]

Runs everything

css(css: str)[source]

Selects a small part of the network to highlight

time module

class k1lib.callbacks.profilers.time.TimeProfiler[source]

Bases: k1lib.callbacks.callbacks.Callback

Profiles execution time. Only measures forward times, as backward times can’t really be measured

run()[source]

Runs everything

css(css: str)[source]

Selects a small part of the network to highlight