diff --git a/.gradle/7.4.2/checksums/checksums.lock b/.gradle/7.4.2/checksums/checksums.lock index 5ffe48a..1d648a5 100644 Binary files a/.gradle/7.4.2/checksums/checksums.lock and b/.gradle/7.4.2/checksums/checksums.lock differ diff --git a/.gradle/7.4.2/checksums/md5-checksums.bin b/.gradle/7.4.2/checksums/md5-checksums.bin index 1edb255..6b73493 100644 Binary files a/.gradle/7.4.2/checksums/md5-checksums.bin and b/.gradle/7.4.2/checksums/md5-checksums.bin differ diff --git a/.gradle/7.4.2/checksums/sha1-checksums.bin b/.gradle/7.4.2/checksums/sha1-checksums.bin index d4afca9..f24a829 100644 Binary files a/.gradle/7.4.2/checksums/sha1-checksums.bin and b/.gradle/7.4.2/checksums/sha1-checksums.bin differ diff --git a/.gradle/7.4.2/executionHistory/executionHistory.bin b/.gradle/7.4.2/executionHistory/executionHistory.bin index 13bfd38..86318ac 100644 Binary files a/.gradle/7.4.2/executionHistory/executionHistory.bin and b/.gradle/7.4.2/executionHistory/executionHistory.bin differ diff --git a/.gradle/7.4.2/executionHistory/executionHistory.lock b/.gradle/7.4.2/executionHistory/executionHistory.lock index 9197817..094f333 100644 Binary files a/.gradle/7.4.2/executionHistory/executionHistory.lock and b/.gradle/7.4.2/executionHistory/executionHistory.lock differ diff --git a/.gradle/7.4.2/fileHashes/fileHashes.bin b/.gradle/7.4.2/fileHashes/fileHashes.bin index 17eb65b..a4d160f 100644 Binary files a/.gradle/7.4.2/fileHashes/fileHashes.bin and b/.gradle/7.4.2/fileHashes/fileHashes.bin differ diff --git a/.gradle/7.4.2/fileHashes/fileHashes.lock b/.gradle/7.4.2/fileHashes/fileHashes.lock index 310a3e2..a285d9d 100644 Binary files a/.gradle/7.4.2/fileHashes/fileHashes.lock and b/.gradle/7.4.2/fileHashes/fileHashes.lock differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 39e96d5..f59b00d 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index e60180a..0a317fb 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe index b37f746..d39032c 100644 Binary files a/.gradle/file-system.probe and b/.gradle/file-system.probe differ diff --git a/build/classes/kotlin/main/Bias.class b/build/classes/kotlin/main/Bias.class index fc01d1b..e5be0ed 100644 Binary files a/build/classes/kotlin/main/Bias.class and b/build/classes/kotlin/main/Bias.class differ diff --git a/build/classes/kotlin/main/Layer.class b/build/classes/kotlin/main/Layer.class index 470fd53..5d4e39e 100644 Binary files a/build/classes/kotlin/main/Layer.class and b/build/classes/kotlin/main/Layer.class differ diff --git a/build/classes/kotlin/main/MeowKt.class b/build/classes/kotlin/main/MeowKt.class index 38cb6e4..44afe3d 100644 Binary files a/build/classes/kotlin/main/MeowKt.class and b/build/classes/kotlin/main/MeowKt.class differ diff --git a/build/classes/kotlin/main/Node.class b/build/classes/kotlin/main/Node.class index 42e0020..1632196 100644 Binary files a/build/classes/kotlin/main/Node.class and b/build/classes/kotlin/main/Node.class differ diff --git a/build/classes/kotlin/main/Perceptron.class b/build/classes/kotlin/main/Perceptron.class index 5d42892..9b7a21c 100644 Binary files a/build/classes/kotlin/main/Perceptron.class and b/build/classes/kotlin/main/Perceptron.class differ diff --git a/build/classes/kotlin/main/Weight.class b/build/classes/kotlin/main/Weight.class index 5cbb248..0aeff61 100644 Binary files a/build/classes/kotlin/main/Weight.class and b/build/classes/kotlin/main/Weight.class differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab index 8e2292a..905a6ce 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream index bc6bd01..13b8703 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at index 56c1069..88df2da 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i index 75da7a7..339e20a 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab index 7e4dccf..7bef40d 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at index 9e078ce..664a08f 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab index bbd1d6b..0e72e62 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at index f25d42f..5551e8c 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab index e0e09f1..2ed5ea0 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at index f83db99..bcbac38 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab index c755a23..3e81fe9 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at index 8f88b0a..79708dd 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab index 0eae28a..d990130 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at index 6c1517f..ab66fc2 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab index edea97d..26240af 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at index 885061a..86045d7 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab index b07fa67..137695d 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab index e92e3ba..febe009 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab index 91572bd..c5e9cc9 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at index ea7771e..a5b8f98 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab index 50511ff..5464798 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream index 636f34a..6e7a926 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len index 29ce11c..eb52963 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len index a9f80ae..93a595b 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at index e97958b..4acb083 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i index e9905b3..6936967 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab index 92f6838..c28fa72 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream index 5ab3a9a..575daa3 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len index 29c5240..8cddd07 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len index 0eb4138..e4c94dc 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at index 3cd0a48..3635b84 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i index f88fda1..27189da 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/last-build.bin b/build/kotlin/compileKotlin/cacheable/last-build.bin index 06c7931..b976fc6 100644 Binary files a/build/kotlin/compileKotlin/cacheable/last-build.bin and b/build/kotlin/compileKotlin/cacheable/last-build.bin differ diff --git a/build/kotlin/compileKotlin/local-state/build-history.bin b/build/kotlin/compileKotlin/local-state/build-history.bin index 9bd9e36..fa77c73 100644 Binary files a/build/kotlin/compileKotlin/local-state/build-history.bin and b/build/kotlin/compileKotlin/local-state/build-history.bin differ diff --git a/src/main/kotlin/Meow.kt b/src/main/kotlin/Meow.kt index dcf9bcd..d018967 100644 --- a/src/main/kotlin/Meow.kt +++ b/src/main/kotlin/Meow.kt @@ -7,8 +7,8 @@ var petal_length_max = 0.0 var petal_width_max = 0.0 fun main() { - val file = File("/run/media/sweetbread/50AF29954CE66E9F/Coding/Kotlin/AI/src/main/resources/IRIS.csv") - val data: List = csvReader().readAll(file).drop(1).map { Iris(it[0].toDouble(), it[1].toDouble(), it[2].toDouble(), it[3].toDouble(), it[4]) } .shuffled() + val file = File("src/main/resources/Iris.csv") + val data: List = csvReader().readAll(file).drop(1).map { Iris(it[1].toDouble(), it[2].toDouble(), it[3].toDouble(), it[4].toDouble(), it[5]) } .shuffled() data.forEach { if (it.sepal_length > sepal_length_max) sepal_length_max = it.sepal_length if (it.sepal_width > sepal_width_max) sepal_width_max = it.sepal_width @@ -20,13 +20,17 @@ fun main() { Layer(4), Layer(4), Layer(3, false) - )) + ), .2) println(model.output()) - model.teach(data.subList(0, 50).map { it.data_field() }.toTypedArray(), 100, false) - data[100].data_field()[1].forEach { print(it.toInt()); print(" ") } - println() - model.input(data[100].data_field()[0]); println(model.output()) + model.teach(data.subList(0, 50).map { it.data_field() }.toTypedArray(), 200, false) + var errors = 0 + data.forEach { + val cor = it.data_field()[1].map{ it.toInt() }; model.input(it.data_field()[0]) + println("Correct: $cor, out: ${model.output_int()}, ${cor==model.output_int()}") + if (cor!=model.output_int()) errors++ + } + println((errors.toDouble()/data.size*100).toInt().toString()+"%") } class Iris ( diff --git a/src/main/kotlin/Perceptron.kt b/src/main/kotlin/Perceptron.kt index 5506af1..8bd1b3e 100644 --- a/src/main/kotlin/Perceptron.kt +++ b/src/main/kotlin/Perceptron.kt @@ -2,8 +2,13 @@ import kotlin.math.pow import kotlin.properties.Delegates class Perceptron (private val layers: Array, private val k: Double = 0.5) { + val input_layer: Layer + val output_layer: Layer init { + input_layer = layers.first() + output_layer = layers.last() + layers.mapIndexed { index, layer -> layer.position = index } for (i in 0..layers.size-2) { println(i) @@ -12,17 +17,17 @@ class Perceptron (private val layers: Array, private val k: Double = 0.5) this.count() } - private fun count() { for (layer in layers) { layer.count() } } + private fun count() { layers.forEach { it.count() }} fun input(array: Array) { - for (index in 0 until layers[0].nodes.dropLast(1).size) { - layers[0].nodes[index].valuE = array[index] + input_layer.nodes.mapIndexed { index, node -> + if (node !is Bias) node.valuE = array[index] } this.count() } private fun backPropagation(input: Array) { - input.mapIndexed { i, v -> layers.last().nodes[i].error = v - layers.last().nodes[i].valuE } + output_layer.nodes.mapIndexed { index, node -> node.error = input[index] - node.valuE } for (layer in layers.drop(1).dropLast(1).reversed()) { for (node in layer.nodes) { node.error = 0.toDouble() @@ -57,6 +62,12 @@ class Perceptron (private val layers: Array, private val k: Double = 0.5) for (node in layers.last().nodes) { output += node.valuE } return output } + + fun output_int(): List { + var output = listOf() + for (node in layers.last().nodes) { output += if (node.valuE > 0.5) 1 else 0 } + return output + } } open class Node(val parent: Layer, private val position: Int) { @@ -88,7 +99,7 @@ class Bias(parent: Layer, position: Int) : Node(parent, position) { override fun getValue() = 1.toDouble() } -class Layer(amount: Int, bias: Boolean = true) { +open class Layer(amount: Int, bias: Boolean = true) { var position by Delegates.notNull() var nodes = listOf() var nextWeight: Weight? = null