Changed project structure

This commit is contained in:
lluni 2022-05-25 17:37:25 +02:00
parent b53328b41c
commit 74e4d05fa1
14 changed files with 50 additions and 4 deletions

2
gradlew vendored
View file

@ -31,7 +31,7 @@
# #
# Busybox and similar reduced shells will NOT work, because this script # Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features: # requires all of these POSIX shell features:
# * functions; # * de.lluni.javann.functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»; # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»; # * compound commands having a testable exit status, especially «case»;

View file

@ -1,3 +1,7 @@
package de.lluni.javann;
import de.lluni.javann.layers.FCLayer;
import de.lluni.javann.layers.Layer;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
import java.util.ArrayList; import java.util.ArrayList;
@ -24,9 +28,9 @@ public class Network {
*/ */
public void addNeuron(int layer, int n) { public void addNeuron(int layer, int n) {
if (!(this.layers.get(layer) instanceof FCLayer)) { if (!(this.layers.get(layer) instanceof FCLayer)) {
System.out.println("This layer is not a BlankLayer"); System.out.println("This layer is not a de.lluni.javann.layers.BlankLayer");
} else if (!(this.layers.get(layer + 2) instanceof FCLayer)) { } else if (!(this.layers.get(layer + 2) instanceof FCLayer)) {
System.out.println("The next layer is not a BlankLayer"); System.out.println("The next layer is not a de.lluni.javann.layers.BlankLayer");
} }
((FCLayer) this.layers.get(layer)).addNeuron(n); ((FCLayer) this.layers.get(layer)).addNeuron(n);
((FCLayer) this.layers.get(layer + 2)).updateInputSize(n); ((FCLayer) this.layers.get(layer + 2)).updateInputSize(n);

View file

@ -1,3 +1,6 @@
package de.lluni.javann.examples;
import de.lluni.javann.util.GradientDescent;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
import java.util.function.Function; import java.util.function.Function;

View file

@ -1,3 +1,11 @@
package de.lluni.javann.examples;
import de.lluni.javann.Network;
import de.lluni.javann.functions.ActivationFunctions;
import de.lluni.javann.functions.LossFunctions;
import de.lluni.javann.layers.ActivationLayer;
import de.lluni.javann.layers.FCLayer;
import de.lluni.javann.util.Utilities;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
import org.knowm.xchart.SwingWrapper; import org.knowm.xchart.SwingWrapper;
import org.knowm.xchart.XYChart; import org.knowm.xchart.XYChart;

View file

@ -1,3 +1,10 @@
package de.lluni.javann.examples;
import de.lluni.javann.Network;
import de.lluni.javann.functions.ActivationFunctions;
import de.lluni.javann.functions.LossFunctions;
import de.lluni.javann.layers.ActivationLayer;
import de.lluni.javann.layers.FCLayer;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
public class ExampleXOR { public class ExampleXOR {

View file

@ -1,3 +1,10 @@
package de.lluni.javann.examples;
import de.lluni.javann.Network;
import de.lluni.javann.functions.ActivationFunctions;
import de.lluni.javann.functions.LossFunctions;
import de.lluni.javann.layers.ActivationLayer;
import de.lluni.javann.layers.FCLayer;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
public class ExampleXORBlankLayers { public class ExampleXORBlankLayers {

View file

@ -1,3 +1,5 @@
package de.lluni.javann.functions;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
public class ActivationFunctions { public class ActivationFunctions {

View file

@ -1,3 +1,5 @@
package de.lluni.javann.functions;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
public class LossFunctions { public class LossFunctions {

View file

@ -1,3 +1,5 @@
package de.lluni.javann.layers;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
import java.util.function.Function; import java.util.function.Function;

View file

@ -1,10 +1,12 @@
package de.lluni.javann.layers;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
import java.util.Random; import java.util.Random;
/** /**
* Goal: initialize layer without any neurons. Not yet implemented. * Goal: initialize layer without any neurons. Not yet implemented.
* Layer initialized with 1 neuron. * de.lluni.javann.layers.Layer initialized with 1 neuron.
* Assumes that each new neuron is fully connected to every previous neuron (this will be changed in the future). * Assumes that each new neuron is fully connected to every previous neuron (this will be changed in the future).
*/ */
public class BlankLayer extends Layer { public class BlankLayer extends Layer {

View file

@ -1,3 +1,6 @@
package de.lluni.javann.layers;
import de.lluni.javann.util.Utilities;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
import java.util.Random; import java.util.Random;

View file

@ -1,3 +1,5 @@
package de.lluni.javann.layers;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
public abstract class Layer { public abstract class Layer {

View file

@ -1,3 +1,5 @@
package de.lluni.javann.util;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;
import java.util.function.Function; import java.util.function.Function;

View file

@ -1,3 +1,5 @@
package de.lluni.javann.util;
import com.opencsv.CSVReader; import com.opencsv.CSVReader;
import com.opencsv.exceptions.CsvValidationException; import com.opencsv.exceptions.CsvValidationException;
import org.ejml.simple.SimpleMatrix; import org.ejml.simple.SimpleMatrix;