Closed robertjankowski closed 5 years ago
Simple UI
Thank you for the pull request! We appreciate it. We think this is a good example model for using NetLogo and Python together, and we have a few comments for you.
One item is on the Info Tab, which at the moment is mostly empty. It'd be good to fill in as much detail as you were able to. You can look at other example models in the NetLogo library for how we usually fill them out. In particular with this model, it'd be important to note the Python libraries used and what they're for.
There were also some code changes:
clear-output
to make sure only the most recent prediction is presented, or switch to having a monitor widget for a prediction variable instead of an output area.draw
procedure changes the view, just run the prediction.draw
procedure - you can either change the model view updates to be Continuous
instead of On Ticks
, or you can add the display
command to the end of your the procedure (preferred). Either way, you should be able to remove the tick
there, since we're not using ticks for anything in this model.pcolor
of each patch into a 2D list, which is converted into an array by np
on the Python side:to-report predict
py:set images (list map (range max-pycor (min-pycor - 1) -1) [ row ->
map (range min-pxcor (max-pxcor + 1)) [ col ->
[ pcolor / 10 ] of patch row col
]
])
report py:runresult "model.predict(np.array(images))[0]"
end
Thanks, again!
Changes:
tick
-> add display
commandinfo
tabThanks for your review. I really appreciate it. I added monitors for handling probabilities from softmax layer and fixed other issues.
Oh, one more quick comment (feel free to ignore). You might consider swapping out the NN model for a fully convolutional one (so, no Dense
layers). Right now, performance suffers when the digit is too far left or right. For instance, try drawing a straight line near the right or left side. It will register as a 4 or a 6 instead of a 1. A fully convolutional network should fix that. Maybe something like adding another conv layer or two on and then finish up with a global avg pooling layer with a softmax activation.
I just added fixes. Referring to the model I think maybe in couple of days I would try to improve NN architecture. Many thanks for your help!
This looks good to me. @qiemem, @robertjankowski: Any further changes, or are we good to merge?
For me PR is ready to merge.
Demo of digits recognition task. I use pretrained model on MNIST dataset.