Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I've Googled, StackOverflowed, everything, and I cannot seem to find a tutorial I can understand. I understand the concept of genetic algorithms, and how to implement them, (Though I haven't tried) but I cannot grasp the concept of neural networks.
I know vaguely how they work... And that's about it. Could someone direct me to a tutorial that could help someone who has not even graduated middle school yet? Sure, I'm several years ahead of the majority of people my grade, but I don't understand summation, (which I apparently need if I don't want a simple binary output) vectors, and other things that I apparently should know.
Is there a simple, bare-bones tutorial for neural networks? After I learn the basics, I'll proceed to more difficult ones. Preferably, they would be in Java.
Thanks!
Summation is just adding up a bunch of things. So,
Summation(1,2,3,4,5) = 1+2+3+4+5 = 15
(note: it's always adding: if you want to subtract, do a summation with negative numbers)
That was easy, right? ;)
A vector is an ordered tuple, which really just means it's bunch of numbers in a specific order. Most often seen in physics to describe position, force, velocity, etc... it's really nothing special, just some ordered numbers, where the ordering is significant:
v = <1,2,3>
If we are talking about geometry, then this vector represents a point in 3-dimensional space where the x coordinate is 1, the y coordinate is 2, and the z coordinate is 3 (See that was easy too, right)?
In neural nets, the vector is usually the vector of inputs to a neuron, so it's really just a list of numeric values. The summation of the vector would be nothing more than adding up all of the values in the vector and getting a single number as a result (which may be referred to as as "scalar" value).
(this was rushed and simplified - I'm sure someone else will help me refine it ;) )
PS. Kudos to you for diving into this stuff at the middle school level! :)
Well, there is this article in Wikipedia's Simple English, but I think you know already all that it contains.
I've had the same problem for a while. I'm a high school student, so you're a little ahead of me. I got a vacation and I used it to learn all I could on backpropagation, and I've found almost no resources that really help too much unless you want to read so much calculus that you want to die. My advice is to first write a perceptron, which is a network with only input layers and output layers. This inspired me o write a post, so hopefully within half an hour of my posting here there should be a tutorial on http://certioraomnia.blogspot.com/. It may be a little late as this question was asked three years ago, but it may help others later.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I was asked this question in an interview.Please provide the solution if you know about this thing.Is there any difference between
for(int i=0;i<=N;i++)
and
for(int i=N;i>=0;i--)
which runs faster and why?
PS: Please differentiate on the basis of performance and the way compiler takes it.I am not asking about the basic difference between postfix and prefix notation.
I think this has the potential to become a better question, if we had more info. You should specify what language you are referring to. If this is JavaScript or something else then you need to mention that.
Secondly, consider revising your question. I suggest asking under which situations one is more appropriate than the other.
Whatever the language, the difference between the two is a stark contrast. The first for-loop involves incrementing a variable until a maximum value is reached (metaphorically-speaking, kind of like a race to the top), while the second involves decrementing a variable until a certain minimum is reached (like a race to the bottom).
Incidentally, in some languages, such as PHP performance is faster in a loop increment expression if you write the increment or decrement operators on the left instead of on the right.
This is an excellent interview question because any answer you give is likely to be wrong and more importantly be something you never previously thought seriously about.
The whole point is to throw you off your game. They want to see how you react when you're pushed into an area that you feel like you should be expert in yet find something about which you are not. Knowing the perfect answer to this question doesn't help you because they'll have 12 more questions lined up to throw you off.
What they want is to see how you respond to this situation. Do you make stuff up? Do you think about it carefully? Can you justify why it's not an important concern? Do you insist your way of looking at it is the only valid way? Do you listen when told of another way? Are you a pain to deal with if told to do it another way?
They will care so much more about the answers to this than whether or not you can save them a CPU clock tick.
But if it turns out you are an expert in this one dusty arcane corner you might earn a point.
If that is your real question then it's a duplicate of this question: Which of these pieces of code is faster in Java?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I am a programming newbie. I am asked to shrink an image to 1/4 its original size. And tutor told me I can replace 4 pixel with one pixel, so as to make it 1/4. How Can I do replacing work in java. Can anyone give me an example?
If you are new to programming then this is absolutely a lesson you should not be undertaking because it involves file IO, loops, data structures, and math. None of these are relevant to the basics you should be learning now.
The basic algorithm would be that you read the pixels in the image into a matrix, and every 2x2 square of pixels could be replaces by one pixel by averaging the colors.
I am not going to give you a full answer because it would involve lots of API lookups to create a fully functional application to do this. There would be a lot of code you probably wouldn't even understand if I showed it to you.
If this is for school, you are either far behind in your studies, or else your teacher is giving an unecessarily complex early assignment. Regardless of where this is coming from, you need to ask for a simpler assignment.
Either way, I recommend you take a step back and solve some simpler problems first so that you understand the components necessary to solve this problem.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have a Java Project I have been working hard on for about 6 months (3 months hardcore) and it is around 8000 lines of code... However I have gotten much better then I was 6 months ago, and I have multiple classes that are full of messy, unorganized, and uncommented code.
Although my new code is much better, I often find myself lost when looking at some of my older code. Do you think it is worth the time to rewrite about 4000-5000 ish lines of code, that I think are not written well? I do not have much time to work, only about 3 hours a day max.
I don't know if I should accept that my old code was old, and just continue on, or if I should go back, completely rewrite most of my program and then have a easier path in the future. Or maybe there is a different solution? Any thoughts? Thanks! I really appreciate the help because currently I don't know if I should proceed knowing I may be just wasting time.
Yes!
Having been in the same position (more than once sadly) I can say that it is well worth it - if you come back to one of your projects in 6 months time - you'll look at that old code and wonder what the heck you were trying to do. Also, you may want to send examples of your work to prospective employers at some point, and if they look at code which is sloppy - it doesnt look good. Worse yet, if they look at the code and see two wildly different styles (sloppy vs neat) they will think you plagiarised the code.
You will also (most likely) find that rewriting those 4k lines of code, results in far fewer lines of code. Or, that it results in code that is far more reusable. Try to think about DRY when you recode (dont repeat yourself) if you use something more than once, make it a function or a class.
Also, you will save LOTS of time in the future when you come to extend/change your work.
Sure go for the rewrite. You are still learning and probably learned a lot since you first started. Now that you know more about programming and have a better idea of what the software requirements are you can probably make it much better.
Having said that, this is just a project for fun. In the business world, you would have to consider the time it takes to do a rewrite in terms of money spent and time and money wasted not adding new features etc and compare that with the amount of money wasted trying to maintain the old system to keep it running. Only if it's cheaper overall to do a rewrite will most businesses go for it.
It may be very beneficial as the other posters have mentioned. You should take this opportunity to write JUnit tests for all your new code (if you're not already doing so), as this will help you write well-encapsulated and decoupled code. Two really good books for reference are Refactoring by Martin Fowler (http://martinfowler.com/books/refactoring.html), and Working Effectively with Legacy Code by Michael Feathers (http://www.amazon.ca/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052).
Have fun!
This is a common question asked by many developers, and it leads to other more important questions that will aid you on your journey to become a better programmer.
Ask yourself:
do i use javadocs in my code?
do i often repeat code?
do i use established patterns and stick with them for the entire project?
The reason i ask is that the answer to these questions will effect how readable your new code will be in the future even if you do rewrite your code.
A good excercise that will prove very useful in the real world is: can i optimize the existing code without rewriting it? this is a much sort after skill if ever you were to program professionally.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
When I practice to take the OCJP exam, I see that the questions that I'm suppose to practice on are often trick questions which try to fool my into answering wrong. The example is from the Bathes / Sierra book and a typical trick question is:
Now I wonder if you can tell me if the questions on the real exam also often are trick questions like these or if the actual exam has another style, or if this is close to what I should expect?
The given example is not tricky. It simply measures that whether you know the difference between constructors and methods. Constructors and methods might have the same name, it is not a compilation error.
The exam may contain questions like these to trip up the participants. However, you should keep in mind that every question in the exam is just for measuring your ability and knowledge in certain exam objectives. You should ask yourself while reading the question: "What objective might this question be measuring?"
Now I wonder if you can tell me if the questions on the real exam also often are trick questions like these or if the actual exam has another style, or if this is close to what I should expect?
The point of grilling you through such questions is to help you get your defenses up. This is not a trick question like #Juvanis has pointed out, but such questions will help you develop a pattern to identify faults in code. Usually a pattern begins to emerge and your brain starts to analyze the code like so...
Do all the necessary imports exist and are they correct ?
Are non-static variables accessed from a static context ?
Check method return values and return type.
Check autoboxing / unboxing errors.
... and so on
The real exam is easier. However if you prepare with harder questions, the chances of succeeding are better.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am working on a java application where i need to do some curve fittings and interpolations. I don't have the theoretical statistical background about that. I appreciate it if anyone can recommend good books covering this topic, but not very advanced ones. If the book provides coding examples in java, it would be greater.
I am not sure of what books to read, but one good place to start would be to look into fitting a Spline. However, the variations on this technique are used to model as closely as possible a curve. For example, Dentists might find this technique very useful.
If you are looking for predictive capabilities, this is an example of how to implement a linear regression. Which, depending on your ultimate goal would be another good place to start.
It is hard to recommend without knowing your mathematics ability, but if you want to understand these concepts you will at the very least require a grasp of linear algebra. I would recommend this book http://www-maths.mcs.st-and.ac.uk/~gmp/gmptheo.html . It describes interpolation and approximation and has some sections on splines which you may find useful. It is aimed at an undergraduate mathematics level - some of the chapters may not be useful to you but if nothing else it will at least highlight the concepts that you need to know in order to understand the things you want to know about. If you find this too advanced, (if you do not have A-level maths or the equivalent) then perhaps consider an introductory text on linear algebra as this is probably the most important concept to understand and is central to approximation and interpolation theory. There are also probably a great many good tutorials available online.