Skip to content
Browse files

Change dater.py to accept dims as in

  $ dater.py DIMS [FILENAME]
  • Loading branch information...
1 parent 34439ae commit c43dd4592ce8d209c7d21977082ad074f59cf3ce @blr246 committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 dater.py
View
8 dater.py
@@ -5,9 +5,13 @@ def __main__(argv):
""" Dater's main method. Write a weights file and exit. """
# Optional command line parameter for weights filename.
- filename = argv[1] if len(argv) > 1 else 'weights.txt'
+ if len(argv) < 2:
+ print "Usage: {0} DIMS [FILENAME]".format(argv[0])
+ return -1
+ dims = eval(argv[1])
+ filename = argv[2] if len(argv) > 2 else 'weights.txt'
# Make a dater and write the weights.
- D = perceptron.Dater()
+ D = perceptron.Dater(dims=dims)
weight_lines = perceptron.Serialization.dater_to_lines(D)
weight_file = open(filename, 'w')
weight_file.writelines(weight_lines)

0 comments on commit c43dd45

Please sign in to comment.
Something went wrong with that request. Please try again.