Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShowAsImage ¶
Example ¶
a := np.NpArray{0.0, 0.1, 0.3, 0.3, 0.1, 0.0}
fmt.Print(ShowAsImage(a))
Output: ....................X................... ......................X................. ..........................X............. ..........................X............. ......................X................. ....................X...................
Types ¶
type Mnist1D ¶
type Mnist1D struct {
NumSamples int `json:"num_samples"`
TrainSplit float64 `json:"train_split"`
Seed uint64 `json:"seed"`
Url string `json:"url"`
Templates Templates
transforms.Rules
}
func NewDefault ¶
func NewDefault() Mnist1D
func (*Mnist1D) GetTemplates ¶
func (Mnist1D) MakeDataset ¶
func (Mnist1D) String ¶
Example ¶
m := NewDefault() fmt.Println(m.String())
Output: Mnist1D{NumSamples: 5000, TrainSplit: 0.8, TemplateLen: 12, Seed: 42, Url: https://github.com/greydanus/mnist1d/raw/master/mnist1d_data.pkl, Templates: Templates{X: [[0.00000000 0.23693955 0.35540933 0.41464421 0.47387910 0.47387910 0.47387910 0.47387910 0.41464421 0.35540933 0.23693955 0.00000000 ] [0.00000000 -0.36986336 -0.36986336 -0.29589069 -0.22191802 -0.14794534 -0.07397267 0.00000000 0.07397267 0.14794534 0.00000000 0.00000000 ] [0.00000000 0.15936381 0.23904572 0.23904572 0.15936381 0.03984095 -0.03984095 -0.15936381 -0.23904572 -0.23904572 -0.15936381 0.00000000 ] [0.00000000 0.26726124 0.40089186 0.40089186 0.26726124 0.00000000 0.00000000 0.26726124 0.40089186 0.40089186 0.26726124 0.00000000 ] [0.00000000 -0.10599979 -0.21199958 -0.31799936 -0.42399915 -0.42399915 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 ] [0.00000000 -0.24771245 -0.24771245 -0.24771245 -0.24771245 0.00000000 0.12385622 0.18578434 0.18578434 0.12385622 -0.06192811 0.00000000 ] [0.00000000 -0.23693955 -0.35540933 -0.41464421 -0.47387910 -0.47387910 -0.47387910 -0.47387910 -0.41464421 -0.35540933 -0.23693955 0.00000000 ] [0.00000000 0.36986336 0.36986336 0.29589069 0.22191802 0.14794534 0.07397267 0.00000000 -0.07397267 -0.14794534 0.00000000 0.00000000 ] [0.00000000 -0.26726124 -0.40089186 -0.40089186 -0.26726124 0.00000000 0.00000000 -0.26726124 -0.40089186 -0.40089186 -0.26726124 0.00000000 ] [0.00000000 -0.28583098 -0.42874646 -0.42874646 -0.28583098 0.00000000 0.00000000 0.00000000 0.00000000 -0.08574929 -0.20008168 0.00000000 ]], T: [-0.83333333 -0.68181818 -0.53030303 -0.37878788 -0.22727273 -0.07575758 0.07575758 0.22727273 0.37878788 0.53030303 0.68181818 0.83333333 ], Y: [0.00000000 1.00000000 2.00000000 3.00000000 4.00000000 5.00000000 6.00000000 7.00000000 8.00000000 9.00000000 ]}, Rules: Rules{Padding: [36 60], TemplateLen: 12, ScaleCoeff: 0.4, MaxTranslation: 48, CorrNoiseScale: 0.25, IidNoiseScale: 0.02, ShearScale: 0.75, ShuffleSeq: false, FinalSeqLength: 40}}
type Templates ¶
func (Templates) String ¶
Example ¶
m := NewDefault() fmt.Println(m.Templates.String())
Output: Templates{X: [[0.00000000 0.23693955 0.35540933 0.41464421 0.47387910 0.47387910 0.47387910 0.47387910 0.41464421 0.35540933 0.23693955 0.00000000 ] [0.00000000 -0.36986336 -0.36986336 -0.29589069 -0.22191802 -0.14794534 -0.07397267 0.00000000 0.07397267 0.14794534 0.00000000 0.00000000 ] [0.00000000 0.15936381 0.23904572 0.23904572 0.15936381 0.03984095 -0.03984095 -0.15936381 -0.23904572 -0.23904572 -0.15936381 0.00000000 ] [0.00000000 0.26726124 0.40089186 0.40089186 0.26726124 0.00000000 0.00000000 0.26726124 0.40089186 0.40089186 0.26726124 0.00000000 ] [0.00000000 -0.10599979 -0.21199958 -0.31799936 -0.42399915 -0.42399915 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 ] [0.00000000 -0.24771245 -0.24771245 -0.24771245 -0.24771245 0.00000000 0.12385622 0.18578434 0.18578434 0.12385622 -0.06192811 0.00000000 ] [0.00000000 -0.23693955 -0.35540933 -0.41464421 -0.47387910 -0.47387910 -0.47387910 -0.47387910 -0.41464421 -0.35540933 -0.23693955 0.00000000 ] [0.00000000 0.36986336 0.36986336 0.29589069 0.22191802 0.14794534 0.07397267 0.00000000 -0.07397267 -0.14794534 0.00000000 0.00000000 ] [0.00000000 -0.26726124 -0.40089186 -0.40089186 -0.26726124 0.00000000 0.00000000 -0.26726124 -0.40089186 -0.40089186 -0.26726124 0.00000000 ] [0.00000000 -0.28583098 -0.42874646 -0.42874646 -0.28583098 0.00000000 0.00000000 0.00000000 0.00000000 -0.08574929 -0.20008168 0.00000000 ]], T: [-0.83333333 -0.68181818 -0.53030303 -0.37878788 -0.22727273 -0.07575758 0.07575758 0.22727273 0.37878788 0.53030303 0.68181818 0.83333333 ], Y: [0.00000000 1.00000000 2.00000000 3.00000000 4.00000000 5.00000000 6.00000000 7.00000000 8.00000000 9.00000000 ]}
Click to show internal directories.
Click to hide internal directories.