Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more examples/documentation #1

Open
MatthewRock opened this issue Jan 19, 2016 · 2 comments
Open

Add more examples/documentation #1

MatthewRock opened this issue Jan 19, 2016 · 2 comments

Comments

@MatthewRock
Copy link

Hello! Nice work there. I am beginner, and I would like to learn machine learning, and probably use your library for this purpose as well. However, right now it's kind of hard to see how things work; from my understanding, examples only show how to train neural networks, not how to use them.

For example, I would like to present other implementation of Recurrent Neural Network:
https://github.com/karpathy/char-rnn

The documentation(or "README", if you will) shows how to install dependencies(this is also kind of lacking, but that's for different conversation), and following the instructions you train and use your nn to generate text. Not so easy with examples in here - I only see how to train the network, but not how to actually use it. I would be very glad if you made some additional documentation.

Also, congratulations on amazing work.

@MatthewRock MatthewRock changed the title Add more examples Add more examples/documentation Jan 19, 2016
@jccerrillo
Copy link

Hello,
I agree this is an amazing project and also think it would be very helpful to have a simple example of using a model once it has been trained.
Congratulations,

jc

@jccerrillo
Copy link

jccerrillo commented Feb 20, 2018

As an example of creating a predict function in digit-fnn.lisp I did the following:
Stored the trained fnn model in net global variable.
Then redifined set-input thus:

(defmethod set-input (digits (fnn digit-fnn))
       (let ((input (nodes (find-clump 'input fnn))))
         (fill! 0 input)
         (loop for i upfrom 0
               for digit in digits
               do (setf (mref input i digit) 1))))

And predict like this:

(defun predict (input-digit)
       (set-input (list input-digit) *net*)
       (forward *net*)
       (let ((output (coerce (mat-to-array (copy-row (nodes (find-clump 'output *net*)) 0)) 'list)))
         (position (apply 'max output) output)))

Evaluating (predict 4) will return the expeted value (mod (1+ d) 3)

Is this the best way to do this?
How would I go about doing the same for the rnn example in sum-sign-rnn.lisp?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants