diff --git a/fit_a_line/train.py b/fit_a_line/train.py index ca2cb0fb6bfff5ee60c32389b601a4f2a05f2e57..7381abe3be20aa0afb27109502d000dabc3f238c 100644 --- a/fit_a_line/train.py +++ b/fit_a_line/train.py @@ -1,6 +1,7 @@ import paddle.v2 as paddle import paddle.v2.dataset.uci_housing as uci_housing + def main(): # init paddle.init(use_gpu=False, trainer_count=1) @@ -25,8 +26,7 @@ def main(): parameters=parameters, update_equation=optimizer) - reader_dict={'x': 0, - 'y': 1} + reader_dict = {'x': 0, 'y': 1} # event_handler to print training and testing info def event_handler(event): @@ -52,5 +52,6 @@ def main(): event_handler=event_handler, num_passes=30) + if __name__ == '__main__': main()