Jupyter compatible analysis frontend

To experiment, run the choost_data() first

Visualize with scatter plot

Ugly prototype

To run interactive filter steps, I can use function returning function

def choose_data():
    latest_tasks = list(i["name"] for i in get_ember_record())[:20]
    def choose_task(task = latest_tasks):
        er = emberReader(task)
        def choose_log(log_file = er.t.log_files):
            html(f"<div>Log file:\t<code>{log_file}</code> selected</div>")
            df = pd.DataFrame(json.loads(er.read_log(log_file)))
            def choose_plot(module = df.module.unique(), 
                            ttype = df.ttype.unique(), 
                           ):
                cols = ["mean","std","max","min","zero_pct"]
                module_df = df[df.module == module]
                global ember_sub_df
                ember_sub_df =  module_df[module_df.ttype == ttype]
                html(f"<h3>Data selected</h3>")
                html(f"<h4>Module:\t{module}</h4>")
                html(f"<h4>Tensor Type:\t{ttype}</h4>")
                if len(ember_sub_df)>0:
                    scatter_cols(ember_sub_df,cols)
                else:
                    html(f"""<div>No such selection under <strong>{module}</Strong> 
                    <br><strong>{ttype}</Strong></div>""")
                return ember_sub_df
            interact_manual(choose_plot)
        sub_df = interact_manual(choose_log)
    html("<h2>Choose from task names</h2>")
    interact(choose_task)

Testing on the crude prototype

choose_data()

It works, just the way of doing it is beyond a self-pretentious python coder can take

Visualize Statictics

OOP improved

html[source]

html(x)

class Visualize[source]

Visualize()

class VisualByTensor[source]

VisualByTensor() :: Visualize

Having test

vis = VisualByTensor()

Useful attributes

vis.df.sample(5)
shape mean std max min cnt_zero zero_pct module ts ttype tname
202605 [10] 1.169974e-09 2.173510e-09 5.122274e-09 -1.920853e-09 1 0.1 model(tinyVGG).fcb(Sequential).3(Linear) 2020-04-11 15:23:53 grad grad_1
147485 [32] -8.100387e-03 2.281245e-02 4.030757e-02 -6.566864e-02 0 0.0 model(tinyVGG).features(Sequential).1(vggBlock... 2020-04-11 15:22:52 weight weight_1
76479 [10] 9.724541e-03 3.381424e-02 4.893364e-02 -6.155158e-02 0 0.0 model(tinyVGG).fcb(Sequential).3(Linear) 2020-04-11 15:21:36 weight weight_1
96134 [16, 64, 3, 3] 8.534161e-01 8.471205e-01 5.928071e+00 -2.168639e-02 0 0.0 model(tinyVGG).features(Sequential) 2020-04-11 15:21:57 output_dt output
190301 [16, 16, 14, 14] 5.344651e-01 7.085245e-01 7.341032e+00 -3.886062e-02 0 0.0 model(tinyVGG).features(Sequential).1(vggBlock... 2020-04-11 15:23:39 input_dt input
vis.ember_sub_df.sample(5)
shape mean std max min cnt_zero zero_pct module ts ttype tname
106230 [16, 1, 3, 3] 8.153300e-03 3.022903e-02 9.953728e-02 -8.875045e-02 0 0.0000 model(tinyVGG).features(Sequential).0(vggBlock... 2020-04-11 15:22:09 grad grad_0
203916 [16, 1, 3, 3] 1.536577e-03 7.859792e-03 2.952960e-02 -1.787023e-02 0 0.0000 model(tinyVGG).features(Sequential).0(vggBlock... 2020-04-11 15:23:56 grad grad_0
196011 [16] 7.799354e-10 2.460518e-08 8.180201e-08 -2.929983e-08 1 0.0625 model(tinyVGG).features(Sequential).0(vggBlock... 2020-04-11 15:23:46 grad grad_1
116817 [16] 4.134011e-08 7.885138e-08 2.931062e-07 -8.208161e-08 0 0.0000 model(tinyVGG).features(Sequential).0(vggBlock... 2020-04-11 15:22:21 grad grad_1
202711 [16] -1.532726e-09 4.049379e-08 7.313577e-08 -8.546601e-08 1 0.0625 model(tinyVGG).features(Sequential).0(vggBlock... 2020-04-11 15:23:53 grad grad_1

Visualize Movement

moving_track[source]

moving_track(x)

clean_module_name[source]

clean_module_name(x)

class VisualMovement[source]

VisualMovement() :: Visualize

vis_m = VisualMovement()