Skip to content

Commit ecf85a8

Browse files
committed
update
1 parent 4cd2c19 commit ecf85a8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

_notebooks/2024-05-01-Percepteron.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@
9797
" }\n",
9898
"\n",
9999
" public static void main(String[] args) {\n",
100-
" double[][] X_train = {{0, 0}, {0, 1}, {1, 0}, {1, 1}};\n",
100+
" double[][] X_train = { {0, 0}, {0, 1}, {1, 0}, {1, 1} };\n",
101101
" int[] y_train = {0, 0, 0, 1};\n",
102102
"\n",
103103
" Perceptron perceptron = new Perceptron(2, 0.1);\n",
104104
" perceptron.train(X_train, y_train, 100);\n",
105105
"\n",
106106
" // Test the trained perceptron\n",
107107
" System.out.println(\"Testing predictions:\");\n",
108-
" double[][] X_test = {{0, 0}, {0, 1}, {1, 0}, {1, 1}};\n",
108+
" double[][] X_test = { {0, 0}, {0, 1}, {1, 0}, {1, 1} };\n",
109109
" for (double[] inputs : X_test) {\n",
110110
" int prediction = perceptron.predict(inputs);\n",
111111
" System.out.println(\"Inputs: \" + Arrays.toString(inputs) + \" Predicted: \" + prediction);\n",

_posts/2024-05-01-Percepteron_IPYNB_2_.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ public class Perceptron {
6767
}
6868

6969
public static void main(String[] args) {
70-
double[][] X_train = {{0, 0}, {0, 1}, {1, 0}, {1, 1}};
70+
double[][] X_train = { {0, 0}, {0, 1}, {1, 0}, {1, 1} };
7171
int[] y_train = {0, 0, 0, 1};
7272

7373
Perceptron perceptron = new Perceptron(2, 0.1);
7474
perceptron.train(X_train, y_train, 100);
7575

7676
// Test the trained perceptron
7777
System.out.println("Testing predictions:");
78-
double[][] X_test = {{0, 0}, {0, 1}, {1, 0}, {1, 1}};
78+
double[][] X_test = { {0, 0}, {0, 1}, {1, 0}, {1, 1} };
7979
for (double[] inputs : X_test) {
8080
int prediction = perceptron.predict(inputs);
8181
System.out.println("Inputs: " + Arrays.toString(inputs) + " Predicted: " + prediction);

0 commit comments

Comments
 (0)