diff --git a/.gradle/7.4.2/executionHistory/executionHistory.bin b/.gradle/7.4.2/executionHistory/executionHistory.bin index 3272623..13bfd38 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 f0ee21c..9197817 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 8d434d2..17eb65b 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 a6d1ee2..310a3e2 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 8336c66..39e96d5 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 fa81d7d..e60180a 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/build.gradle.kts b/build.gradle.kts index b454a58..6a85f95 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,6 +13,7 @@ repositories { dependencies { testImplementation(kotlin("test")) + implementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.6.0") } tasks.test { diff --git a/build/classes/kotlin/main/Bias.class b/build/classes/kotlin/main/Bias.class index 185fdd9..fc01d1b 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/Functions.class b/build/classes/kotlin/main/Functions.class deleted file mode 100644 index 496c81d..0000000 Binary files a/build/classes/kotlin/main/Functions.class and /dev/null differ diff --git a/build/classes/kotlin/main/Layer.class b/build/classes/kotlin/main/Layer.class index 924dc11..470fd53 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 06b8179..38cb6e4 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 c21b826..42e0020 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 2787af4..5d42892 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 4cd3644..5cbb248 100644 Binary files a/build/classes/kotlin/main/Weight.class and b/build/classes/kotlin/main/Weight.class differ diff --git a/build/classes/kotlin/main/activation_fun$Companion.class b/build/classes/kotlin/main/activation_fun$Companion.class deleted file mode 100644 index d5557ea..0000000 Binary files a/build/classes/kotlin/main/activation_fun$Companion.class and /dev/null differ diff --git a/build/classes/kotlin/main/activation_fun.class b/build/classes/kotlin/main/activation_fun.class deleted file mode 100644 index 2a03369..0000000 Binary files a/build/classes/kotlin/main/activation_fun.class and /dev/null 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 9d62918..8e2292a 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.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at index 54decc1..56c1069 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/jvm/kotlin/class-attributes.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab index 01f42e9..7e4dccf 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.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream index 163faac..76f7026 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len index 209b35b..b9a3d70 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len 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 f60b549..9e078ce 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-attributes.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i index d6419c9..e8c995c 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i 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 87b802e..bbd1d6b 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.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream index 163faac..76f7026 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len index 209b35b..b9a3d70 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len 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 8bcb48d..f25d42f 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/class-fq-name-to-source.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i index d6419c9..e8c995c 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i 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 768d326..e0e09f1 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.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream index 5b899d1..354e268 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len index 8790089..209b35b 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len 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 53e2824..f83db99 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/internal-name-to-source.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i index 04c4670..8981e54 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i 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 aa56697..c755a23 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 41f26f4..8f88b0a 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 ed93f24..0eae28a 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.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream index 72c2baf..113c43a 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len index 002e02c..abb4d9e 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len 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 e8eb615..6c1517f 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/proto.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i index adef275..dd33632 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i 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 5e853e8..edea97d 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 f8bbd0f..885061a 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 fc9520d..b07fa67 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/subtypes.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream index 69e1b82..f2d8b95 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len index 8f2199b..62f3e6f 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len index 01bdaa1..2a17e6e 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at index ebd6081..d5012c2 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i index 07aba4e..b79fa44 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i 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 6731d7e..e92e3ba 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/jvm/kotlin/supertypes.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream index 766e8bb..8f78753 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len index 933d553..62f3e6f 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len index 01bdaa1..2a17e6e 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at index 718c573..4cce44b 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i index 248da89..faeee11 100644 Binary files a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i 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 61c5ae4..91572bd 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 1126e6b..ea7771e 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 c82cda2..50511ff 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.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at index fabdbcd..e97958b 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/lookups.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab index 7c42236..92f6838 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 8c4a5bf..5ab3a9a 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 e2f61da..29c5240 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 7f8c89f..0eb4138 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 c9700e1..3cd0a48 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 6ceabcd..f88fda1 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 a9666e1..06c7931 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 72963b8..9bd9e36 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 ae159df..dcf9bcd 100644 --- a/src/main/kotlin/Meow.kt +++ b/src/main/kotlin/Meow.kt @@ -1,15 +1,49 @@ +import com.github.doyaaaaaken.kotlincsv.dsl.csvReader +import java.io.File + +var sepal_length_max = 0.0 +var sepal_width_max = 0.0 +var petal_length_max = 0.0 +var petal_width_max = 0.0 + fun main() { - val model = Perceptron(3, arrayOf(), 2) - model.teach( - arrayOf( - arrayOf(arrayOf(0.0, 0.0, 1.0), arrayOf(0.0, 0.0)), - arrayOf(arrayOf(0.0, 1.0, 0.0), arrayOf(1.0, 0.0)), - arrayOf(arrayOf(1.0, 0.0, 1.0), arrayOf(0.0, 1.0)), - arrayOf(arrayOf(1.0, 1.0, 1.0), arrayOf(1.0, 1.0)) - ), 10000 - ) - model.input(arrayOf(0.0, 0.0, 1.0)); println(model.output()) - model.input(arrayOf(0.0, 1.0, 1.0)); println(model.output()) - model.input(arrayOf(1.0, 0.0, 0.0)); println(model.output()) - model.input(arrayOf(1.0, 1.0, 0.0)); println(model.output()) + 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() + 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 + if (it.petal_length > petal_length_max) petal_length_max = it.petal_length + if (it.petal_width > petal_width_max) petal_width_max = it.petal_width + } + + val model = Perceptron(arrayOf( + Layer(4), + Layer(4), + Layer(3, false) + )) + 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()) +} + +class Iris ( + val sepal_length: Double, + val sepal_width: Double, + val petal_length: Double, + val petal_width: Double, + val species: String + ) { + fun data_field(): Array> { + return arrayOf( + arrayOf(sepal_length/sepal_length_max, sepal_width/sepal_width_max, petal_length/petal_length_max, petal_width/petal_width_max), + arrayOf( + if (species == "Iris-setosa") 1.0 else 0.0, + if (species == "Iris-versicolor") 1.0 else 0.0, + if (species == "Iris-virginica") 1.0 else 0.0 + ) + ) + } } \ No newline at end of file diff --git a/src/main/kotlin/Perceptron.kt b/src/main/kotlin/Perceptron.kt index 183678c..5506af1 100644 --- a/src/main/kotlin/Perceptron.kt +++ b/src/main/kotlin/Perceptron.kt @@ -1,124 +1,108 @@ import kotlin.math.pow +import kotlin.properties.Delegates -class Perceptron (val input_n: Int, val hidden_n: Array = arrayOf(), val output_n: Int, val k: Double = 0.5) { - val layers: List +class Perceptron (private val layers: Array, private val k: Double = 0.5) { init { - var tmp_layers = listOf() - - tmp_layers += Layer(input_n, 0) - - for (layer_n in hidden_n) { - for (layer in 0 until layer_n) { - tmp_layers += Layer(layer, layer+1) - } - } - - tmp_layers += Layer(output_n, tmp_layers.size) - tmp_layers.last().nodes = tmp_layers.last().nodes.dropLast(1) - - layers = tmp_layers - - for (i in layers.indices-1) { + layers.mapIndexed { index, layer -> layer.position = index } + for (i in 0..layers.size-2) { println(i) Weight(layers[i], layers[i+1]) } this.count() } - fun count() { - for (layer in layers) { layer.count() } - } + private fun count() { for (layer in layers) { layer.count() } } fun input(array: Array) { for (index in 0 until layers[0].nodes.dropLast(1).size) { - layers[0].nodes[index].value = array[index] + layers[0].nodes[index].valuE = array[index] } this.count() } - fun back_propo(input: Array) { - for (i in input.indices) { layers.last().nodes[i].error = input[i] - layers.last().nodes[i].value } - for (layer in layers.dropLast(1).reversed()) { + private fun backPropagation(input: Array) { + input.mapIndexed { i, v -> layers.last().nodes[i].error = v - layers.last().nodes[i].valuE } + for (layer in layers.drop(1).dropLast(1).reversed()) { for (node in layer.nodes) { node.error = 0.toDouble() - for (n_node in node.next_nodes) { - node.error += n_node.error * layer.next_weight!!.weight[listOf(node, n_node)]!! + for (n_node in node.nextNodes) { + node.error += n_node.error * layer.nextWeight!!.weight[listOf(node, n_node)]!! } } } for (layer in layers.dropLast(1)) { for (node in layer.nodes) { - for (n_node in node.next_nodes) { - node.parent.next_weight!!.weight[listOf(node, n_node)] = - node.parent.next_weight!!.weight[listOf(node, n_node)]!! + - k * n_node.error * activation_fun.logistic_(n_node.value)*node.value + for (n_node in node.nextNodes) { + node.parent.nextWeight!!.weight[listOf(node, n_node)] = + node.parent.nextWeight!!.weight[listOf(node, n_node)]!! + + k * n_node.error * ActivationFun.logisticDerivative(n_node.valuE)*node.valuE } } } } - fun teach(sets: Array>>, epochs: Int = 100000) { + fun teach(sets: Array>>, epochs: Int = 100000, silent: Boolean = true) { for (epoch in 1..epochs) { - println("epoch #$epoch") + if (!silent) println("epoch #$epoch") for (set in sets) { this.input(set[0]) - this.back_propo(set[1]) + this.backPropagation(set[1]) } } } fun output(): List { var output = listOf() - for (node in layers.last().nodes) { output += node.value } + for (node in layers.last().nodes) { output += node.valuE } return output } } -open class Node(val parent: Layer, val position: Int) { - open var value = 0.toDouble() +open class Node(val parent: Layer, private val position: Int) { + open var valuE = 0.toDouble() var error = 0.toDouble() - // var tmp = 0.toDouble() - var prev_nodes = listOf() - var next_nodes = listOf() + var prevNodes = listOf() + var nextNodes = listOf() - open fun get_value(): Double { - return if (prev_nodes.isEmpty()) value + open fun getValue(): Double { + return if (prevNodes.isEmpty()) valuE else { - value = 0.toDouble() - for (node in prev_nodes) { - value += node.value * parent.prev_weight!!.weight[listOf(node, this)]!! + valuE = 0.toDouble() + for (node in prevNodes) { + valuE += node.valuE * parent.prevWeight!!.weight[listOf(node, this)]!! } // tmp = value - value = activation_fun.logistic(value) - value + valuE = ActivationFun.logistic(valuE) + valuE } } override fun toString(): String { - return "[${parent.position}:${position} | $value ]" + return "[${parent.position}:${position} | $valuE ]" } } class Bias(parent: Layer, position: Int) : Node(parent, position) { - override var value = 1.toDouble() - override fun get_value() = 1.toDouble() + override var valuE = 1.toDouble() + override fun getValue() = 1.toDouble() } -class Layer(amount: Int, val position: Int) { +class Layer(amount: Int, bias: Boolean = true) { + var position by Delegates.notNull() var nodes = listOf() - var next_weight: Weight? = null - var prev_weight: Weight? = null + var nextWeight: Weight? = null + var prevWeight: Weight? = null init { for (i in 0 until amount) { nodes += Node(this, i) } - nodes += Bias(this, nodes.size) + if (bias) nodes += Bias(this, nodes.size) } fun count() { - for (node in nodes) { node.get_value() } + for (node in nodes) { node.getValue() } } } @@ -126,15 +110,15 @@ class Weight(prev_: Layer, next_: Layer) { var weight = HashMap, Double>() init { - prev_.next_weight = this - next_.prev_weight = this + prev_.nextWeight = this + next_.prevWeight = this for (input_node in prev_.nodes) { for (output_node in next_.nodes) { if (output_node is Bias) continue weight[listOf(input_node, output_node)] = Math.random() - input_node.next_nodes += output_node - output_node.prev_nodes += input_node + input_node.nextNodes += output_node + output_node.prevNodes += input_node } } @@ -142,13 +126,9 @@ class Weight(prev_: Layer, next_: Layer) { } } -class activation_fun { +class ActivationFun { companion object{ fun logistic(x: Double) = 1/(1 + Math.E.pow(-x)) - fun logistic_(x: Double) = x * (1 - x) + fun logisticDerivative(x: Double) = x * (1 - x) } } - -enum class Functions { - Logistic -} \ No newline at end of file