Mistake in ra25 code
Closed this issue · 0 comments
The current code for ra25 has a simple mistake in the code for the ConfigPats and the OpenPats function copied below. The ConfigPats saves the generated file with the .csv extension and the etable.Comma setting, whereas the OpenPats function opens the file with the .tsv extension and the etable.Tab setting. Presumably they should be consistent. I had an issue where I used ConfigPats to generate the structure of my training data and then tried to use the OpenPats command to read in the training data later, which didn't work. It failed to find the file. When I made them consistent, everything was fine.
func (ss *Sim) ConfigPats() {
dt := ss.Pats
dt.SetMetaData("name", "TrainPats")
dt.SetMetaData("desc", "Training patterns")
sch := etable.Schema{
{"Name", etensor.STRING, nil, nil},
{"Input", etensor.FLOAT32, []int{5, 5}, []string{"Y", "X"}},
{"Output", etensor.FLOAT32, []int{5, 5}, []string{"Y", "X"}},
}
dt.SetFromSchema(sch, 25)
patgen.PermutedBinaryRows(dt.Cols[1], 6, 1, 0)
patgen.PermutedBinaryRows(dt.Cols[2], 6, 1, 0)
dt.SaveCSV("random_5x5_25_gen.csv", etable.Comma, etable.Headers)
}
func (ss *Sim) OpenPats() {
dt := ss.Pats
dt.SetMetaData("name", "TrainPats")
dt.SetMetaData("desc", "Training patterns")
err := dt.OpenCSV("random_5x5_25.tsv", etable.Tab)
if err != nil {
log.Println(err)
}
}