Mercurial > hg > dml-open-cliopatria
diff cpack/dml/examples/csv_op_viewer.swinb @ 0:718306e29690 tip
commiting public release
author | Daniel Wolff |
---|---|
date | Tue, 09 Feb 2016 21:05:06 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpack/dml/examples/csv_op_viewer.swinb Tue Feb 09 21:05:06 2016 +0100 @@ -0,0 +1,65 @@ +<div class="notebook"> + +<div class="nb-cell program"> +:- use_module(library(computations)). +:- use_module(library(mlserver)). +:- use_module(library(real)). +:- use_module(library(dml_c3)). +:- include(search). +:- use_rendering(rdf,[resource_format(nslabel)]). +:- use_rendering(c3). + +transform_memo(Class,Transform,In,Out) :- + transform(Class,Transform), + computation_memo(Transform,In,Out). + +op_chart(Op,CSV,Chart) :- + csv_op(Op,CSV,Result), + csv_op_chart(Op,Result,Chart). +</div> + +<div class="nb-cell markdown"> +Histogram of durations of computations on CSV files. +</div> + +<div class="nb-cell query"> +findall(Dur,browse(computations:csv_op_memo(A,B,_C),comp(_,_,Dur)-ok),_Durs), +[Counts,Map] === hist1d(transpose(_Durs),edgemap(0:0.01:2)), +array_list(Counts,_LC), +c3_hist(steps,dur,Map,_LC,Chart). +</div> + +<div class="nb-cell markdown"> +Recording level analyses... +</div> + +<div class="nb-cell query"> +distinct(A,browse(computations:csv_op_memo(A,B,_C),comp(_,_,Dur)-ok)), +computation(_,Rec,B), +writeln(doing(A,B)), +csv_op_chart(A,_C,D). +</div> + +<div class="nb-cell markdown"> +Collection level analyses... +</div> + +<div class="nb-cell query"> +distinct(Name/Arity, + ( browse(perspectives:cla_memo(A,B,_C),comp(_,_,Dur)-ok), + functor(A,Name,Arity))), +cla_op_chart(A,_C,Chart), +dataset_size(B,Size). +</div> + +<div class="nb-cell markdown"> +This example shows how VAMP computations can be triggered on demand. +</div> + +<div class="nb-cell query"> +X :: title(piano) /\ title(sonata), +transform_memo(tempo,_,X,Y), +op_chart(uniform_tempo_r(linear,2),Y,Chart). +</div> + +</div>