4 ms·
Also, my first Rust project!
by tectonic 8y ago
Also, my first Rust project!
- bhargav_ 8y agoThis is such a cool project! Plus a pretty awesome example of using Rust for CLI's. I'm curious about the neural network though. Is that also written in Rust? Or are you embedding something else?
- tectonic 8y agoThanks! It is written in Rust. It's a very simple NN with one hidden layer and back propagation.
- bhargav_ 8y agoJust saw the implementation. It's goes a little over my head unfortunately, but I am curious about the affects of it. Did you compare the non-neural net version with the neural net version? If so what differences did you find?
- tectonic 8y agoI found that the neural network does a little better than a simple linear regression function for weighting the parameters. I train it on a few months of my own shell history to predict, based on the last commands, what I'll type next.
- 2bitencryption 8y agoare the default weights I see in the code the result of your own local training?
- tectonic 8y agoYup
- the_jeremy 8y agoMinor nitpick: probably better to append to PROMPT_COMMAND, rather than overwriting it.
- tectonic 8y agoI do actually append to it: PROMPT_COMMAND="__last_exit=\$?;history -a \$MCFLY_HISTORY;mcfly add --exit \$__last_exit --append-to-histfile;history -cr \$MCFLY_HISTORY;${PROMPT_COMMAND}"
- faitswulff 8y agoWhat made you choose Rust? And what were your impressions of it for this project?
- tectonic 8y agoI wanted a fast, safe systems language. I enjoyed it! The learning curve is steep but then you start to get it.
- darkjedi_emacs 8y agohaha Feels same. My first program in rust was https://github.com/AkshayIyer12/advent-of-code/blob/master/2018/aoc1/src/main.rs https://github.com/AkshayIyer12/advent-of-code/blob/master/2... . Felt good finally writing some code in Rust after the rust lang book.