Skip to content

Commit

Permalink
Use c2s.load_data() instead of pickle.load() in training script
Browse files Browse the repository at this point in the history
This allows the use of training data stored as Matlab files.
  • Loading branch information
lucastheis committed Sep 18, 2016
1 parent 6b1ca14 commit e6d5e59
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/c2s-train.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
import sys

from argparse import ArgumentParser, HelpFormatter
from pickle import load
from numpy import mean, corrcoef, unique
from numpy.random import rand, randint
from cmt.utils import random_select
from c2s import train, predict, preprocess
from c2s import train, predict, preprocess, load_data
from c2s.experiment import Experiment

def main(argv):
Expand Down Expand Up @@ -60,9 +59,8 @@ def main(argv):
return 0

data = []
for dataset in args.dataset:
with open(dataset) as handle:
data = data + load(handle)
for filepath in args.dataset:
data.extend(load_data(filepath))

if args.preprocess:
data = preprocess(data, args.verbosity)
Expand Down

0 comments on commit e6d5e59

Please sign in to comment.