-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgocunets_netio_stats_html.go
More file actions
62 lines (60 loc) · 1.86 KB
/
gocunets_netio_stats_html.go
File metadata and controls
62 lines (60 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package gocunets
//import (
// "fmt"
// "html/template"
//
// "github.com/dereklstinson/gocunets/devices/gpu/nvidia/cudnn"
// "github.com/dereklstinson/gocunets/ui/uihelper"
//)
////GetHTMLedStats gets the stats put into html form
//func (m *Network) GetHTMLedStats(handle *cudnn.Handler) (string, error) {
// x, err := m.GetStats(handle)
// if err != nil {
// return "", err
// }
// return string(combine(MakeHTMLTemplates(x))), nil
//
//}
//
////MakeHTMLTemplates preps the HTML so that it can be called with GetHTMLedstats
//func MakeHTMLTemplates(input []*LayerIOStats) []template.HTML {
// section := make([]template.HTML, len(input))
// for i := range input {
// section[i] = input[i].makedivsection()
// }
// return section
//}
//func (l *LayerIOStats) makedivsection() template.HTML {
// section := make([]template.HTML, 0)
// section = append(section, uihelper.Header("3", l.Name))
// section = append(section, uihelper.Header("4", l.Weights.Name))
// section = append(section,
// uihelper.Paragraphsusingbreaks(
// fmt.Sprintf("%s=%f", "Min", l.Weights.Min),
// fmt.Sprintf("%s=%f", "Max", l.Weights.Max),
// fmt.Sprintf("%s=%f", "Avg", l.Weights.Avg),
// fmt.Sprintf("%s=%f", "Norm1", l.Weights.Norm1),
// fmt.Sprintf("%s=%f", "Norm2", l.Weights.Norm2),
// ))
// if !l.IO {
//
// section = append(section, uihelper.Header("4", l.Bias.Name))
// section = append(section,
// uihelper.Paragraphsusingbreaks(
// fmt.Sprintf("%s=%f", "Min", l.Bias.Min),
// fmt.Sprintf("%s=%f", "Max", l.Bias.Max),
// fmt.Sprintf("%s=%f", "Avg", l.Bias.Avg),
// fmt.Sprintf("%s=%f", "Norm1", l.Bias.Norm1),
// fmt.Sprintf("%s=%f", "Norm2", l.Bias.Norm2),
// ))
// }
// return uihelper.DivRegular(combine(section))
//}
//
//func combine(input []template.HTML) (section template.HTML) {
// for i := range input {
// section = section + input[i]
// }
// return section
//}
//