tweak layout, add title

This commit is contained in:
Starbeamrainbowlabs 2023-02-16 19:24:48 +00:00
parent 9e9942da19
commit f0ca9f0ec6
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 13 additions and 8 deletions

View file

@ -7,11 +7,12 @@ body {
font-family: Ubuntu, sans-serif;
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: auto 1fr auto;
grid-template-areas: "header header"
"left right"
"footer footer";
grid-template-columns: 1fr;
grid-template-rows: auto 75vh 1fr auto;
grid-template-areas: "header"
"summary"
"graph"
"footer";
}
h1 {
@ -21,11 +22,11 @@ h1 {
}
#input-summary {
grid-area: left;
grid-area: summary;
}
#output-graph {
grid-area: right;
grid-area: graph;
}
footer {

View file

@ -7,7 +7,7 @@
<body>
<h1>Tensorflow Summary Visualisation</h1>
<textarea name="input-summary" id="input-summary"></textarea>
<textarea name="input-summary" id="input-summary" placeholder="Paste a tensorflow summary here"></textarea>
<div id="output-graph"></div>
<footer>

View file

@ -4,6 +4,10 @@ import nomnoml from 'nomnoml';
export default function make_graph(summary) {
const result = [];
result.push("#.title: visual=none title=center,bold body=center,bold");
result.push(`[<title>Model: ${summary.title}|Total params: ${summary.params}|Trainable params: ${summary.params_trainable}|Non-trainable params: ${summary.params_trainable}|${summary.layers.length} layers, ${summary.edges.length} edges]`)
for(const layer of summary.layers) {
const output_shape = layer.output_shape.replace(/\[/, "\\[")
.replace(/\]/, "\\]");