Exemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var view      = new NetworkView();
            var model     = new NetworkModel();
            var presenter = new NetworkPresenter(view, model);

            Application.Run(view);
        }
Exemplo n.º 2
0
        public NetworkPresenter(NetworkView view, NetworkModel model)
        {
            model.SetInputLayerSize  = view.ShowInputLayerSize;
            model.SetHiddenLayerSize = view.ShowHiddenLayerSize;
            model.SetOutputLayerSize = view.ShowOutputLayerSize;

            model.Log = view.Log;

            view.SetInputLayerSize  = (size) => model.InputLayerSize = size;
            view.SetHiddenLayerSize = (size) => model.HiddenLayerSize = size;
            view.SetOutputLayerSize = (size) => model.OutputLayerSize = size;
            view.SetLearningRate    = (size) => model.LearningRate = size;
            view.CreateNetwork      = model.CreateNetwork;
            view.TrainNetwork       = model.TrainFixed;

            model.Initialize();
        }