Jump to content

Mark-XP

Member
  • Posts

    177
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Germany

Everything posted by Mark-XP

  1. @Dietmar as far as i can see no magic: you're not excluding anything here for (int i = 0; i < trainingInputs.length; i++) { if (trainingInputs[i][0] != 211 && trainingInputs[i][0] != 212 && ... since trainingInputs [j] [0] is allways 0 or 1 and hence the above condition doesn't catch. it would be indeed use- and helpful to add the decimal value of the number in the first element trainingInputs [j] [0]
  2. Ok @Dietmar, it obviously has learned it's lessons (nn.train) well. But if you train it only up to 200: /* for (int i = 0; i < trainingInputs.length; i++) { */ for (int i = 0; i < 201; i++) { the results for higher nubers (201..255) do not convince me.
  3. Hello @Dietmar, i'm back again. You shurely did observe what happened with it's prediction for 11010 (26) above: that's really stupid, and later predictions get worse again and again. Not my taste of learning Maybe you should give it a try in tertiary number system!?
  4. Hello @Dietmar an a happy easter! Sorry but i don't see any learning curve here in regards of prime-recognition (see attatchment). Just as you stated above Primes1_Out.txt
  5. Hello @Dietmar, i think you mixed up odd and even in some System.out.printf statements in the while-block. I tried to make it a bit easier, only one double as input: package multi; import org.neuroph.core.data.DataSet; import org.neuroph.core.data.DataSetRow; import org.neuroph.nnet.MultiLayerPerceptron; import org.neuroph.nnet.learning.BackPropagation; import java.util.Scanner; public class Multi1 { public static void main(String[] args) { // create MultiLayerPerceptron neural network MultiLayerPerceptron neuralNet = new MultiLayerPerceptron(1, 4,4, 2); neuralNet.setLearningRule(new BackPropagation()); // create training set DataSet trainingSet = new DataSet(1, 2); trainingSet.add(new DataSetRow(new double[]{0}, new double[]{1, 0})); //even trainingSet.add(new DataSetRow(new double[]{1}, new double[]{0, 1})); //odd trainingSet.add(new DataSetRow(new double[]{2}, new double[]{1, 0})); //even trainingSet.add(new DataSetRow(new double[]{4}, new double[]{1, 0})); //even trainingSet.add(new DataSetRow(new double[]{7}, new double[]{0, 1})); //odd trainingSet.add(new DataSetRow(new double[]{5}, new double[]{0, 1})); //odd trainingSet.add(new DataSetRow(new double[]{11}, new double[]{0, 1})); //odd trainingSet.add(new DataSetRow(new double[]{12}, new double[]{1, 0})); //even Scanner scanner = new Scanner(System.in); while (true) { System.out.println("Enter a number or 'exit' to quit:"); String inputStr = scanner.nextLine(); if (inputStr.equals("exit")) { break; } // String inputStrArray = inputStr; double input = Double.parseDouble(inputStr); neuralNet.setInput(input); neuralNet.calculate(); double[] output = neuralNet.getOutput(); System.out.printf("Network prediction: %.2f even, %.2f odd %n", output[0], output[1]); if (output[0] > output[1]) { System.out.print("I think this is even. Is that correct? (y/n) "); String answer = scanner.nextLine(); if (answer.equals("y")) { trainingSet.add(new DataSetRow(new double[]{input}, new double[]{1, 0})); } else { // correcting as odd trainingSet.add(new DataSetRow(new double[]{input}, new double[]{0, 1})); } } else { System.out.print("I think this is odd. Is that correct? (y/n) "); String answer = scanner.nextLine(); if (answer.equals("y")) { trainingSet.add(new DataSetRow(new double[]{input}, new double[]{0, 1})); } else { // correcting as even trainingSet.add(new DataSetRow(new double[]{input}, new double[]{1, 0})); } } // train neural network with updated training set neuralNet.learn(trainingSet); } // save trained neural network neuralNet.save("oddoreven.nnet"); } } But then i have endless loops in neuralNet.learn and java running hot again...
  6. Hi @Dietmar, the AI learns by experiences, just to refine weight's and biases of it's Neurons. This is what made me thinking "For (0 and 0) it is 10 times more secure about the result than for (1 and 0)... it hasn't understood the essence of the matter (logical and) at all" (here) The bias values outside [-1, 1] are not astonishing to me a priori: your Backpropagation has to be examinated carefully: bias1[i] += learningRate * hidden1Errors[i] * tanhDerivative(hidden1[i] Btw.: on my current System Ivy Bridge with 4 GB RAM (built years ago to host Win-XP 32) it's not possible to run the last example with a 1000 nodes per hidden Layer! Had to reduce it to 100 nodes...
  7. @Dietmar Not exactly Tanh, it's scaled. Let sSig be the above funtion: sSig = 2 * sig(x) - 1 : Then sSig' (0) = 0.5 but Tanh'(0) = 1. Anyway, with Sigmoid/tanh you're on the right track.
  8. @Dietmar then, what about feedForward like ... = 2.0 * sigmoid(sum) - 1.0; The output will be in around 0, but halftimes negative
  9. @Dietmar Yes: now the output (in several runs) seems more equal distributed (between -1 and 1). Tanh is flatter than sigmoid, hence outputs seem to be more ,scattered'. Hence, for a stable NN i would prefer a sigmoid TransferFunction (rather than Tanh). (at my currently low knowledge state about NNs)
  10. @Dietmar This seems rather obvious since Tanh is negative for a nagative input (tanh "=" 2 x sigmoid - 1). Edit: since i don't know what you wanna achieve, i cannot consider it correct or wrong
  11. @Dietmar, all the weights are initialised randomly, hence the output seem to be somewhat Gauss distributed with center around the average of the both inputs. Is this a deeper investigation of how a NN works (2 hidden layers x 2 nodes, recalculated (forwardfed) utilizing sigmoid function?
  12. Yes @Dietmar, you're absolutely right! Did you know that today most new pharaceutical ingredients/agents for medicines are found by AI? The same for primes or chess: when the spaces of possibilities are sheer endless and the solutions very rare, the machine will beat humans. You probably know that Stephen Hawking warned about the situation when AI will begin to improve itself? A realy dystopian idea...
  13. VERY nice job, @Dietmar! I'm honestly in awe of how you get deeply into the matter... stark! This last example is extremely useful in regards of how the A"I" is working: let the trainig run loop for only 10.000 times (not 100.000) and the output is absolutely astonishing (at least for me): 0 AND 0 = 0.002703633461159949 0 AND 1 = 0.028244357868107424 1 AND 0 = 0.02999418942102172 1 AND 1 = 0.9603305464776584 For (0 and 0) it is 10 times more secure about the result than for (1 and 0). I derive 2 things: First, it's learning capabilities are terrific, intimidating. And second: it hasn't understood the essence of the matter at all.
  14. Yes @Dietmar, i agree to name it ,hanging' - and would like to adress it to the developer(s) as i posted above... (if you're ok with it). What's the Belgrad bibliothek? Can't find that with qwant. Edit: @Dietmar HA!! your Asrock z690 Extreme has an Intel i219-V on it - maybe you like to have a look in my topic which i created for it...
  15. Hello @Dietmar, so you're obviously enjoying your hollidays, very nice ! Just a couple of remarks/questions: - What ,crash' do you mean? Jave running hot (infinite) after entering a new trainingElement? - What is "Neuroph Neural Network Bibliothek from Belgrad" - i can't find nothing. - I've got no resources problem at all with tiere on an Z77E machine with only 4 GB of RAM: it just uses 438 MB (-> pic.1) - However, i have problems to include the neuroph-docs in Eclipse-IDE: no Info in the popup when hovering the mouse over the NeuralNetwork class (-> pic 2) - i try to make an image recognition progi that can learn to seperate Men from women portraits. But that will take some time... have a nice day!
  16. seems to work: String eingabe = ""; // Evtl. vorhandenes (trainiertes) NN laden: File f = new File("or_perceptron.nnet"); if (f.exists() && !f.isDirectory()) { System.out.println("Soll or_perceptron.nnet geladen werden: "); eingabe = scanner.nextLine().toLowerCase(); System.out.println(""); if (eingabe.equals("y") || eingabe.equals("j")) { System.out.println("or_perceptron.nnet laden... "); neuralNetwork = NeuralNetwork.createFromFile ("or_perceptron.nnet"); } } ... // while (true) { while (! eingabe.equals("save")) { } neuralNetwork.save ("or_perceptron.nnet");
  17. Do i understand you well @Dietmar , you spoke with one AI about another? I find this so.. amazing SciFi, really extraordinary! And of course that is a bug in Neuroph, and we should imo report it, here. it could be done easyly by sending them the link with your java source (eg. this) and the link to my post above. Ok, that said, now i'll finally begin to study the documentations of Neuroph... Edit: Nice, on page 13 of "Getting Started with Neuroph 2.98.pdf" (inside neuroph 2.98 zip) are described the mehods save and createFromFile to save and load previously trained neuro-networks ...
  18. Now this is interesting @Dietmar: i tried to ,teach' it to seperate odd from even: starting with '2' it estimates Hund and i inform him: that's correct. (Hund = even - if first answer is Katze we define Katze = even). After trainung with 3 additional valus (7, 55, 88 see picture) the Java runtime is running hot, but the prgram doesn't work anymore. That happens in both environments, XP and Win7 (with slightly different Java versions)! Are you able to reproduce?
  19. @Dietmar oh yes, it runs nicely! (After having added the 3 neuroph-core lib's sleepwalking safely (in the night) i struggeld hours in eclipse to add the other 3 libs the next morning...something went very wrong) Ok, i roughly understand the concept of the sigmoid-Fkt. (as a threshold function to decide when a neuron should "fire") in a neuro-net, and it's well limited, but tbh. i havn't understood it's meaning for search for primes. Maybe you have a good example or link? Huundd and Mietzie seems too ,fuzzy' for me. I'd like to find an application of this in rather binary situations; like i wrote before: decide if a portrait shows a man or a women. (Like it's just done in medicin: AI decides if flesh-texture is cancer or good-natured).
  20. @Dietmar, thank you very much again for sharing this truely interesting stuff here! I must say the Neroph framework is an impressive tool (especially in regard of the small size of the package!) but the results of "tiere" - tbh - isn't overwhelming either. I'm very curious for the libraries neuroph-imgrec... does it really mean "image recognition"? i have to read the docs... a system that could learn to seperate women (portraits) from men (portraits) would be sensational! For the moment unfortunately i have yet to struggle hard with the eclipe IDE, please look at this ridiculous behavior of the help window when i hover the mouse over the class Scanner, to get some info: it tells me black on black background :
  21. The point is: they (MS, Google, meta and others) won't never rebuild uman's brain in total, only small parts, and with all the rest (with needs, fears etc.) they have nothing to do... hopefully we'll have (political) powers in the future, that will have an ethic-view on this development... Currently stuck to integrate javax.visrec.ml.data.DataSet, thank you @Dietmar with the idea to change to maven... i'll be back Edit: it's such a mess, i struggle to import the libs you mentioned: it stores visrec in a new folder javax but the error persists... Edit2: OK! Now i've learnd how to integrate visrec-api correctly
  22. The problem resides in line 15 (also in latest eclipse/Java environment on Win7); NeuralNetwork<?> neuralNetwork = new MultiLayerPerceptron(TransferFunctionType.SIGMOID, 26, 20, 20, 3); @Dietmar, could you please check if your tier-project imports something like org/slf4j? Edit: as far as i can see, all the knowlege you teach the AI in a session/run is lost then, and in each session it has to be trained newly from the scratch?! Wouldn't it be nice to implement - as a next step - to store all the learned things in a db? Edit2: i've found latest SLF4J API Module (2.0.7).jar, imported it to tier-project but error persists... error is solved! Edit3: next error, line 19 (DataSet trainingSet = new DataSet(26, 3);) causes ClassNotFoundException: javax.visrec.ml.data.DataSet . Try to resolve this... @Dietmar did you have this issues too, or is Netbeans simply better prepared than Eclipse??
  23. Hallo nochmal, @Dietmar, i was too curious: integration of neuroph-core seems ok, but first attempt to run your example ends with some errors, there's an unknown org/slf4j/LoggerFactory here... we'll see tomorrow, have to sleep now...
  24. Hi @Dietmar, latest (youngest) portable Eclipse/JDK combo i found (until now) is Eclipse 4.7.2 / Jportable 8u131. I could indeed reanimate my Börsen-chart project (unfortunately yahoo doesn't provide any marketdata any more).... Now i download the neuroph package (many thanks!), but then first want try to integrate it in eclipse (which i'm a little bit familiar with - netbeans would be another new IDE to learn and struggle with... ). Very curious about to experience AI live on my pc... until later! Edit: and the whole AI is packed to only 10 MB? Wow!!!
  25. Many thanks @Dietmar, i downloaded that package! Since i'm somwahar compulsive, i first have to try to reanimate my old project with eclipse and best portable. In Win7/64 i have a success both, Eclipse and Java (OpenJDK64) portable. It's nice to see Oracle's Java running caged within another process (see below). Now i have to see what's (versions) possible to run portable in XP/32, and later try out Netbeans - at the moment i'am not able to complie your Tierbeispiel.java above in eclipse/ant: imports from org.neuroph not resolved... until later!
×
×
  • Create New...