-
Notifications
You must be signed in to change notification settings - Fork 1
/
info.go
37 lines (33 loc) · 932 Bytes
/
info.go
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
package cnn
import (
"github.com/dereklstinson/gocunets/devices/gpu/nvidia/cudnn/convolution"
"github.com/dereklstinson/gocunets/devices/gpu/nvidia/cudnn/tensor"
)
//"github.com/dereklstinson/gocunets/devices/gpu/nvidia/cudnn/convolution"
// "github.com/dereklstinson/gocunets/layers"
//Info contains the info that is needed to build a CNN layer
type Info struct {
Convolution convolution.Info `json:"convolution,omitempty"`
Weights tensor.Info `json:"weights,omitempty"`
Bias tensor.Info `json:"bias,omitempty"`
}
//Info returns the info struct for the convolution
func (l *Layer) Info() (Info, error) {
cinfo, err := l.conv.Info()
if err != nil {
return Info{}, err
}
winfo, err := l.w.Info()
if err != nil {
return Info{}, err
}
binfo, err := l.bias.Info()
if err != nil {
return Info{}, err
}
return Info{
Convolution: cinfo,
Weights: winfo,
Bias: binfo,
}, nil
}