-
Notifications
You must be signed in to change notification settings - Fork 49
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
Code is not readable #4
Comments
thank you for your interest in this program. Up to a few days ago it was only used for research purpose by a few researcher of my same team, and I did not care too much about (important) implementation issues, including comments. But now that many other researcher are interested in this work, for sure I'll do it as soon as I can. Concerning peer review, we had an article subject to peer review; the reviewer did not have to judge the software, they had to judge the model, and I can tell you that they did it very accurately. If I submitted a paper about the software I would have taken care before about implementation issues, as I did with other projects. |
Hi @golosio, EDIT: I'm reading your paper "A cognitive neural architecture able to learn and communicate through natural language" and found out that SSM stands for "sparse-signal map", right? |
Hi jotadepicas, |
Yes, I know. Almost all the articles you refer to are about skynet, the machines taking over and the end of the world :P However, my area of interest is the same as yours. Btw, I've finished all your docs! Is there any forum o something like that to discuss about them? (here?). |
Sorry, at the moment I do not use a forum. You can write here or to my email address golosio@uniss.it |
Besides documentation, one other thing it would be great to do is to make the code adhere to some coding conventions. I like Google's (https://google.github.io/styleguide/cppguide.html#Type_Names), which is more or less general and covers a lot of topics. I don't think one should choose to follow a coding convention in a dogmatic way, but whatever convention you choose, should be consistent across all the project. For example, all classes names starting with a capital letter, all variables starting with lowercase, using camel-case everywhere, etc. Makes it easier to navigate the code. I've just forked the repo, and I'll be happy to contribute in this matter whenever I manage to find the time if you are ok with it :) |
Sure. I had a look at Google's, it seems that the main difference between Google's coding convention and the one that I use is that I use lowercase with underscores for temporary variables, and CamelCase for class members (both for variables and functions). Maybe we can agree on a convention that requires less changes to the code and when we have time check that it is applied consistently... |
Yes, I'd focus on the big things first. For example, classes should be capitalized and variables viceversa. One example is ssm class should be called SSM and variables and instance members of that type should be ssm. |
Hi guys, |
this looks really great. I'm really into neural networks and artificial learning of semantics . I've even begun my own neural network library, though it needs some work. Id love to learn how this program works, and I also think it would benefit from some documentation . |
Thank you Josh, |
I went to a random file and decided to look at some random lines:
https://github.com/golosio/annabell/blob/master/src/fssm.h#L51-L57
They define some available methods on the
fssm
type:Nowhere is it explained what any of these operations are, why they would ever be called, what they are supposed to return, or even what an
fssm
is supposed to be (besides a kind ofssm
). I realize that the meanings of the acronyms would no doubt be clearer to someone with more of a neural networks and NLP background than myself, but even if I knew what things were being referred to and had an idea of what one might want to do with those things, it would still be very challenging to understand how those things are being represented in code.Also take, for example, these other lines:
https://github.com/golosio/annabell/blob/master/src/fssm.cc#L457-L471
They look like this:
They're clearly doing some kind of 2d loop over something, and calling other
Activ()
methods from thisActiv()
method. I would guess that they're passing on activation from a neuron, but if that's correct it's due to what I already know, not what I gleaned from the code, and if it's wrong it's because the code isn't sufficiently clear to disabuse me of my preconceived notions.If I were checking this code to make sure that it didn't have bugs during the peer review process, I would remain thoroughly unconvinced. If I don't know what it's for, I can't know if it works correctly.
Documentation should be added to every file (to let the reader know what is defined there), to every class (to document what it is and why it is needed), to every method and member (to document what the method or member means and when it is to be used, and what the arguments and return types, if any, are supposed to be), and to every nontrivial code structure (to explain why the code as written would be expected to function correctly, given what the method it's in is specified as doing). Without this documentation, nobody will ever be able to know why (or even whether) the code presented works correctly.
The text was updated successfully, but these errors were encountered: