Skip to content

Commit 27fc867

Browse files
authored
Merge pull request #17 from EntropyOrg/nb-add-timer
Use Devel::Timer to time prediction
2 parents 2a04810 + ff9a0d9 commit 27fc867

File tree

2 files changed

+67
-9
lines changed

2 files changed

+67
-9
lines changed

lib/AI/TensorFlow/Libtensorflow/Manual/Notebook/InferenceUsingTFHubEnformerGeneExprPredModel.pod

Lines changed: 38 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

notebook/InferenceUsingTFHubEnformerGeneExprPredModel.ipynb

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
"output_type": "stream",
335335
"text": [
336336
"Checking with saved_model_cli scan:\n",
337-
"MetaGraph with tag set ['serve'] does not contain the default denylisted ops: {'ReadFile', 'WriteFile', 'PrintV2'}\n"
337+
"MetaGraph with tag set ['serve'] does not contain the default denylisted ops: {'ReadFile', 'PrintV2', 'WriteFile'}\n"
338338
]
339339
},
340340
{
@@ -1186,7 +1186,9 @@
11861186
"cell_type": "code",
11871187
"execution_count": 18,
11881188
"id": "5effa39f",
1189-
"metadata": {},
1189+
"metadata": {
1190+
"scrolled": true
1191+
},
11901192
"outputs": [
11911193
{
11921194
"name": "stderr",
@@ -1197,13 +1199,32 @@
11971199
" \u001b[0;38;5;104mDims \u001b[m \u001b[0;38;5;81m[\u001b[m \u001b[0;38;5;209m1\u001b[m \u001b[0;38;5;209m896\u001b[m \u001b[0;38;5;209m5313\u001b[m \u001b[0;38;5;81m]\u001b[m\n",
11981200
" \u001b[0;38;5;104mNumDims \u001b[m \u001b[0;38;5;209m3\u001b[m\n",
11991201
" \u001b[0;38;5;104mElementCount \u001b[m \u001b[0;38;5;209m4760448\u001b[m\n",
1200-
"\u001b[0;38;5;81m}\u001b[m\n"
1202+
"\u001b[0;38;5;81m}\u001b[m\n",
1203+
"\n",
1204+
"\n",
1205+
"Devel::Timer Report -- Total time: 14.5641 secs\n",
1206+
"Interval Time Percent\n",
1207+
"----------------------------------------------\n",
1208+
"01 -> 02 14.5634 100.00% prediction of sequence -> End of prediction of sequence\n",
1209+
"02 -> 03 0.0007 0.00% End of prediction of sequence -> END\n",
1210+
"00 -> 01 0.0000 0.00% INIT -> prediction of sequence\n"
12011211
]
12021212
}
12031213
],
12041214
"source": [
1215+
"use Devel::Timer;\n",
1216+
"my $t = Devel::Timer->new;\n",
1217+
"\n",
1218+
"$t->mark('prediction of sequence');\n",
1219+
"\n",
12051220
"my $predictions = $predict_on_batch->( $session, FloatPDLTOTFTensor( $sequence_one_hot ) );\n",
1206-
"p $predictions;"
1221+
"\n",
1222+
"$t->mark('End of prediction of sequence');\n",
1223+
"\n",
1224+
"p $predictions;\n",
1225+
"\n",
1226+
"$t->mark('END');\n",
1227+
"$t->report();"
12071228
]
12081229
},
12091230
{
@@ -2509,7 +2530,9 @@
25092530
"\n",
25102531
"$gp->close;\n",
25112532
"\n",
2512-
"IPerl->png( bytestream => path($plot_output_path)->slurp_raw );"
2533+
"if( IN_IPERL ) {\n",
2534+
" IPerl->png( bytestream => path($plot_output_path)->slurp_raw );\n",
2535+
"}"
25132536
]
25142537
},
25152538
{
@@ -2607,7 +2630,7 @@
26072630
"file_extension": ".pl",
26082631
"mimetype": "text/x-perl",
26092632
"name": "perl",
2610-
"version": "5.30.0"
2633+
"version": "5.36.0"
26112634
}
26122635
},
26132636
"nbformat": 4,

0 commit comments

Comments
 (0)