Content Type
Profiles
Forums
Events
Everything posted by Dietmar
-
@Mark-XP Download neuroph 2.98 from here https://ufile.io/zpm08yru Extract it. Now comes the most most crazy part. Only this way works for me. Open in Netbeans above left on top "New Project". On next page choose "Java with Ant" and "Java Application". Nothing more, click "next". Type in "Project Name" in small letters "tiere". Green Mark is set for "Create Main Class" "tiere.Tiere" click finish. On the screen on the right side now delete all and after deleting all there, copy and paste whole "tiere" txt there. Now click on the left page "tiere" "Libraries". With right mouse click on "Libraries" and choose there "Add JAR/Folder", click on it with left mouse. Now search for your folder neuroph-2.98. Click on slf4 175 jar after this on slf4 176 jar visrec api 100 jar neuroph core 2.98 jar After this procedure, all Libraries that you need for the "tiere" program, are there, good luck Dietmar PS: May be there is a way to include all the Libraries from Neuroph into the Standard Libraries from Java. Until now, I di not succeed with it. So, for me only the way above works. Here is the whole tested code for "tiere" again. This program is crazy good and shows ALL, whatever an Artificial Intelligence can do at Maximum. No question, this is intelligent. I choose this program for to look for prim numbers, works. It has higher IQ than Chat GPT. package tiere; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import org.neuroph.core.NeuralNetwork; import org.neuroph.core.data.DataSet; import org.neuroph.core.data.DataSetRow; import org.neuroph.nnet.MultiLayerPerceptron; import org.neuroph.util.TransferFunctionType; public class Tiere { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); NeuralNetwork<?> neuralNetwork = new MultiLayerPerceptron(TransferFunctionType.SIGMOID, 26, 20, 20, 3); DataSet trainingSet = new DataSet(26, 3); Map<String, String> bewertungen = new HashMap<>(); Map<String, String> antworten = new HashMap<>(); while (true) { System.out.println("Gib ein Wort ein:"); String eingabe = scanner.nextLine().toLowerCase(); if (eingabe.equals("liste")) { for (String wort : bewertungen.keySet()) { String bewertung = bewertungen.get(wort); String antwort = antworten.get(wort); System.out.println(wort + ": " + bewertung + " (" + antwort + ")"); } continue; } double[] input = createInputVector(eingabe); neuralNetwork.setInput(input); neuralNetwork.calculate(); double[] output = neuralNetwork.getOutput().clone(); String ergebnis = bestimmeErgebnis(output); System.out.println("Ich schätze, dass es sich um " + ergebnis + " handelt."); System.out.println("War meine Antwort richtig? (Ja/Nein)"); String antwort = scanner.nextLine().toLowerCase(); antworten.put(eingabe, antwort); if (antwort.startsWith("n")) { double[] gewünschteAusgabe = new double[3]; System.out.println("Welches Tier ist es? (Hund, Katze, nix)"); String tier = scanner.nextLine().toLowerCase(); switch (tier) { case "hund": gewünschteAusgabe[0] = 1; break; case "katze": gewünschteAusgabe[1] = 1; break; default: gewünschteAusgabe[2] = 1; break; } DataSetRow trainingElement = new DataSetRow(input, gewünschteAusgabe); trainingSet.add(trainingElement); neuralNetwork.learn(trainingSet); String bewertung = gewünschteAusgabe[0] == 1 ? "Hund" : gewünschteAusgabe[1] == 1 ? "Katze" : "nix"; bewertungen.put(eingabe, bewertung); System.out.println("Ich habe etwas Neues dazugelernt."); } else { String bewertung = ergebnis; bewertungen.put(eingabe, bewertung); } } } // Hilfsmethode zum Erstellen des Eingabevektors private static double[] createInputVector(String eingabe) { double[] input = new double[26]; for (int i = 0; i < eingabe.length(); i++) { char c = eingabe.charAt(i); if (c >= 'a' && c <= 'z') { input[c - 'a'] = 1; } } return input; } // Hilfsmethode zum Bestimmen des Ergebnisses aus der Ausgabe des Netzwerks private static String bestimmeErgebnis(double[] output) { if (output[0] > output[1] && output[0] > output[2]) { return "Hund"; } else if (output[1] > output[0] && output[1] > output[2]) { return "Katze"; } else { return "nix"; } } }
-
@Mark-XP Here is Netbeans 16 and Java 8.151 . First install Java under XP SP3. Then, you only have to look for netbeans.exe Dietmar https://ufile.io/cdsnn01j
-
Hi, I make a new program with Java Netbeans, Ant. This one is much more intelligent in predicting the next number. It takes the whole input "number sequence" as the one and only thing, with which the Neural Network is trained. This means: Also the whole sequence in the numbers is stored for the learning process. I get a feeling, that not much more (!) can be done with Ai and this kind of Neural Network. Whole functions could be interpreted!!! One crazy thing I notice: Because of Normalization with 1000, small numbers give more bad results, dont know if the cause for this is the Sigmoid Function or just crazy round to zero by Java Dietmar package zahlen; import java.util.ArrayList; import java.util.Scanner; import org.neuroph.core.NeuralNetwork; import org.neuroph.core.data.DataSet; import org.neuroph.core.data.DataSetRow; import org.neuroph.nnet.MultiLayerPerceptron; import org.neuroph.util.TransferFunctionType; public class Zahlen { public static void main(String[] args) { ArrayList<Double> numbers = new ArrayList<>(); Scanner scanner = new Scanner(System.in); boolean isInputActive = true; while (isInputActive) { String input = scanner.next(); switch (input) { case "list": if (numbers.size() == 0) { System.out.println("Die Liste ist leer."); } else { for (double number : numbers) { System.out.println(number); } } break; case "q": System.out.println("Eingabe beendet. Geben Sie 'quit' ein, um das Programm zu beenden, oder 'list', um die Liste der Zahlen anzuzeigen."); break; case "quit": System.out.println("Das Programm wird beendet."); isInputActive = false; break; default: try { double number = Double.parseDouble(input); numbers.add(number / 1000.0); } catch (NumberFormatException e) { System.out.println("Ungültige Eingabe."); } break; } } scanner.close(); int inputSize = numbers.size(); int outputSize = 1; DataSet trainingSet = new DataSet(inputSize, outputSize); for (int i = 0; i < numbers.size() - 1; i++) { double[] inputArray = new double[numbers.size()]; for (int j = 0; j < numbers.size(); j++) { inputArray[j] = numbers.get(j); } double[] outputArray = new double[]{numbers.get(i+1)}; trainingSet.add(new DataSetRow(inputArray, outputArray)); } // create neural network NeuralNetwork neuralNet = new MultiLayerPerceptron(TransferFunctionType.SIGMOID, inputSize, 300, 300,300,300,300,300,300, outputSize); // train the neural network neuralNet.learn(trainingSet); // use the trained neural network to predict the next number in the sequence double[] inputArray = new double[numbers.size()]; for (int j = 0; j < numbers.size(); j++) { inputArray[j] = numbers.get(j); } neuralNet.setInput(inputArray); neuralNet.calculate(); double[] predictedOutput = neuralNet.getOutput(); // scale the predicted output back up to its original range double predictedNumber = predictedOutput[0] * 1000.0; // print the predicted output System.out.println("Das nächste Element könnte sein: " + predictedNumber); } }
-
@TheFighterJetDude The acpi.sys build from Sources for XP SP3 is more stable on newer compis, than the acpi.sys from Sources for Bit64 XP. On the Gigabyte z690 UD DDR4 the Bios update helps a lot. But anyway, to work with Bios is a risk for whole compi. I "succeed" 2 times, that after correct Bios update compi was "dead", one time even with BiosFlashBack, Dietmar
-
@TheFighterJetDude Your board has an 1 x PS/2 Keyboard/Mouse combo port. So you can disable any USB in Bios and look, if compi starts. Then you can enable step by step the USB ports. Also has this board an COM1 port. There you can connect a serial mouse Dietmar PS: Update Bios to its last version. But any Bios update is always a risk.
-
@TheFighterJetDude Disable in Device Manager the HID device, that is not your USB mouse. As you can see on my photo, I did the same. This HID device is for the LED control of the motherboard and it crashes your compi, as it did with all my z690 boards and I get report from other users with z690 or z790 boards about the same crash with this strange HID device Dietmar
-
Hi, can you give me 3 names for a cat and 3 names for a dog? Thanks a lot Dietmar
-
Yesssa, I have the prove: The name Tima was first interpreted as "Hund" dog. But after training, Tima was first interpreted as "Katze" cat. I never tell the program, that Tima is the name of a cat. This means: Machines can learn things, that they have never done before. They can do more, than the programmer told them. A year ago, I would tell everybody, that this is nonsense. But the little, nice program above teach me, that I was wrong Dietmar
-
Next version of this nice Ai program, where now you can see, that it learns. My next test of this program here will be, if after training, NEW words are correct at once, which have been done before wrong. I mean words, that the program has never seen before and during first test get a (n). Now, if all works as expected, the same word should get a (j) after training on first try. This behavior, if it happens, I would say is pur Intelligence. For example, the program can learn, if this is a name for a dog or for a cat. Not seen before those names. This program looks, if a user put in via keyboard a dog (Hund) or cat (Katze) or other (nix). This input words are all stored. When you type "liste", the list of all until now via keyboard transported words are listed. AND: If they are correct (j) or wrong (n) interpreted from Ai. In next step, when you correct Ai (n) ==> (j) always. Oh, just now I try different names for dogs and cats for example "Bello" and "Tima" Dietmar package tiere; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import org.neuroph.core.NeuralNetwork; import org.neuroph.core.data.DataSet; import org.neuroph.core.data.DataSetRow; import org.neuroph.nnet.MultiLayerPerceptron; import org.neuroph.util.TransferFunctionType; public class Tiere { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); NeuralNetwork<?> neuralNetwork = new MultiLayerPerceptron(TransferFunctionType.SIGMOID, 26, 20, 20, 3); DataSet trainingSet = new DataSet(26, 3); Map<String, String> bewertungen = new HashMap<>(); Map<String, String> antworten = new HashMap<>(); while (true) { System.out.println("Gib ein Wort ein:"); String eingabe = scanner.nextLine().toLowerCase(); if (eingabe.equals("liste")) { for (String wort : bewertungen.keySet()) { String bewertung = bewertungen.get(wort); String antwort = antworten.get(wort); System.out.println(wort + ": " + bewertung + " (" + antwort + ")"); } continue; } double[] input = createInputVector(eingabe); neuralNetwork.setInput(input); neuralNetwork.calculate(); double[] output = neuralNetwork.getOutput().clone(); String ergebnis = bestimmeErgebnis(output); System.out.println("Das Programm schätzt, dass es sich um " + ergebnis + " handelt."); System.out.println("War das Ergebnis korrekt? (Ja/Nein)"); String antwort = scanner.nextLine().toLowerCase(); antworten.put(eingabe, antwort); if (antwort.startsWith("n")) { double[] gewünschteAusgabe = new double[3]; System.out.println("Um welches Tier handelt es sich korrekterweise? (Hund, Katze, nix)"); String tier = scanner.nextLine().toLowerCase(); switch (tier) { case "hund": gewünschteAusgabe[0] = 1; break; case "katze": gewünschteAusgabe[1] = 1; break; default: gewünschteAusgabe[2] = 1; break; } DataSetRow trainingElement = new DataSetRow(input, gewünschteAusgabe); trainingSet.add(trainingElement); neuralNetwork.learn(trainingSet); String bewertung = gewünschteAusgabe[0] == 1 ? "Hund" : gewünschteAusgabe[1] == 1 ? "Katze" : "nix"; bewertungen.put(eingabe, bewertung); System.out.println("Das neuronale Netzwerk wurde aktualisiert."); } else { String bewertung = ergebnis; bewertungen.put(eingabe, bewertung); } } } // Hilfsmethode zum Erstellen des Eingabevektors private static double[] createInputVector(String eingabe) { double[] input = new double[26]; for (int i = 0; i < eingabe.length(); i++) { char c = eingabe.charAt(i); if (c >= 'a' && c <= 'z') { input[c - 'a'] = 1; } } return input; } // Hilfsmethode zum Bestimmen des Ergebnisses aus der Ausgabe des Netzwerks private static String bestimmeErgebnis(double[] output) { if (output[0] > output[1] && output[0] > output[2]) { return "Hund"; } else if (output[1] > output[0] && output[1] > output[2]) { return "Katze"; } else { return "nix"; } } }
-
This is the same program via Ai, for to look only via keyboard, if an cat "Katze" or dog "Hund" or other "nix" ,that the human, who types the word, means. But now you can see all the new learned words, when you type "liste". The words, the Ai interprets correct in first try, are not in this list Dietmar package tiere; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import org.neuroph.core.NeuralNetwork; import org.neuroph.core.data.DataSet; import org.neuroph.core.data.DataSetRow; import org.neuroph.nnet.MultiLayerPerceptron; import org.neuroph.util.TransferFunctionType; public class Tiere { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); NeuralNetwork<?> neuralNetwork = new MultiLayerPerceptron(TransferFunctionType.SIGMOID, 26, 20, 20, 3); DataSet trainingSet = new DataSet(26, 3); Map<String, String> bewertungen = new HashMap<>(); // Neues Bewertungs-Dictionary while (true) { System.out.println("Gib ein Wort ein:"); String eingabe = scanner.nextLine().toLowerCase(); if (eingabe.equals("liste")) { // Wenn "liste" eingegeben wird for (String wort : bewertungen.keySet()) { System.out.println(wort + ": " + bewertungen.get(wort)); // Gib alle Bewertungen aus } continue; } double[] input = createInputVector(eingabe); neuralNetwork.setInput(input); neuralNetwork.calculate(); double[] output = neuralNetwork.getOutput().clone(); String ergebnis = bestimmeErgebnis(output); System.out.println("Das Programm schätzt, dass es sich um " + ergebnis + " handelt."); System.out.println("War das Ergebnis korrekt? (Ja/Nein)"); String antwort = scanner.nextLine().toLowerCase(); if (antwort.startsWith("j")) { continue; } double[] gewünschteAusgabe = new double[3]; System.out.println("Um welches Tier handelt es sich korrekterweise? (Hund, Katze, nix)"); String tier = scanner.nextLine().toLowerCase(); switch (tier) { case "hund": gewünschteAusgabe[0] = 1; break; case "katze": gewünschteAusgabe[1] = 1; break; default: gewünschteAusgabe[2] = 1; break; } DataSetRow trainingElement = new DataSetRow(input, gewünschteAusgabe); trainingSet.add(trainingElement); neuralNetwork.learn(trainingSet); String bewertung = gewünschteAusgabe[0] == 1 ? "Hund" : gewünschteAusgabe[1] == 1 ? "Katze" : "nix"; bewertungen.put(eingabe, bewertung); // Füge Bewertung zum Dictionary hinzu System.out.println("Das neuronale Netzwerk wurde aktualisiert."); } } // Hilfsmethode zum Erstellen des Eingabevektors private static double[] createInputVector(String eingabe) { double[] input = new double[26]; for (int i = 0; i < eingabe.length(); i++) { char c = eingabe.charAt(i); if (c >= 'a' && c <= 'z') { input[c - 'a'] = 1; } } return input; } // Hilfsmethode zum Bestimmen des Ergebnisses aus der Ausgabe des Netzwerks private static String bestimmeErgebnis(double[] output) { if (output[0] > output[1] && output[0] > output[2]) { return "Hund"; } else if (output[1] > output[0] && output[1] > output[2]) { return "Katze"; } else { return "nix"; } } }