Ajout du perceptron multi-couches

This commit is contained in:
Philippe Roy 2023-06-25 18:43:54 +02:00
parent ff0b9052c5
commit 8e7c1f55dd
2 changed files with 4 additions and 4 deletions

View File

@ -159,14 +159,14 @@ z3_pmc_xor = pmc_xor(x1_mg, x2_mg, activation=tanh)
z4_pmc_xor = pmc_xor(x1_mg, x2_mg, activation=relu) z4_pmc_xor = pmc_xor(x1_mg, x2_mg, activation=relu)
pmc_xor_echelon_ax = fig.add_subplot(2,4,3) pmc_xor_echelon_ax = fig.add_subplot(2,4,3)
pmc_xor_echelon_ax.set_title("Xor PMC par Échelon") pmc_xor_echelon_ax.set_title("XOR PMC par Échelon")
pmc_xor_echelon_ax.contourf(x1_mg, x2_mg, z1_pmc_xor) pmc_xor_echelon_ax.contourf(x1_mg, x2_mg, z1_pmc_xor)
pmc_xor_echelon_ax.plot([0, 1], [0, 1], "rs", markersize=15) pmc_xor_echelon_ax.plot([0, 1], [0, 1], "rs", markersize=15)
pmc_xor_echelon_ax.plot([0, 1], [1, 0], "g^", markersize=15) pmc_xor_echelon_ax.plot([0, 1], [1, 0], "g^", markersize=15)
pmc_xor_echelon_ax.grid(True) pmc_xor_echelon_ax.grid(True)
pmc_xor_sigmoid_ax = fig.add_subplot(2,4,4) pmc_xor_sigmoid_ax = fig.add_subplot(2,4,4)
pmc_xor_sigmoid_ax.set_title("Xor PMC par Sigmoïde") pmc_xor_sigmoid_ax.set_title("XOR PMC par Sigmoïde")
pmc_xor_sigmoid_ax.contourf(x1_mg, x2_mg, z2_pmc_xor) pmc_xor_sigmoid_ax.contourf(x1_mg, x2_mg, z2_pmc_xor)
pmc_xor_sigmoid_ax.plot([0, 1], [0, 1], "rs", markersize=15) pmc_xor_sigmoid_ax.plot([0, 1], [0, 1], "rs", markersize=15)
pmc_xor_sigmoid_ax.plot([0, 1], [1, 0], "g^", markersize=15) pmc_xor_sigmoid_ax.plot([0, 1], [1, 0], "g^", markersize=15)
@ -177,14 +177,14 @@ pmc_xor_tanh_ax.contourf(x1_mg, x2_mg, z3_pmc_xor)
pmc_xor_tanh_ax.plot([0, 1], [0, 1], "rs", markersize=15) pmc_xor_tanh_ax.plot([0, 1], [0, 1], "rs", markersize=15)
pmc_xor_tanh_ax.plot([0, 1], [1, 0], "g^", markersize=15) pmc_xor_tanh_ax.plot([0, 1], [1, 0], "g^", markersize=15)
pmc_xor_tanh_ax.grid(True) pmc_xor_tanh_ax.grid(True)
pmc_xor_tanh_ax.set_xlabel("Xor PMC par Tanh", fontsize=12) pmc_xor_tanh_ax.set_xlabel("XOR PMC par Tanh", fontsize=12)
pmc_xor_relu_ax = fig.add_subplot(2,4,8) pmc_xor_relu_ax = fig.add_subplot(2,4,8)
pmc_xor_relu_ax.contourf(x1_mg, x2_mg, z4_pmc_xor) pmc_xor_relu_ax.contourf(x1_mg, x2_mg, z4_pmc_xor)
pmc_xor_relu_ax.plot([0, 1], [0, 1], "rs", markersize=15) pmc_xor_relu_ax.plot([0, 1], [0, 1], "rs", markersize=15)
pmc_xor_relu_ax.plot([0, 1], [1, 0], "g^", markersize=15) pmc_xor_relu_ax.plot([0, 1], [1, 0], "g^", markersize=15)
pmc_xor_relu_ax.grid(True) pmc_xor_relu_ax.grid(True)
pmc_xor_relu_ax.set_xlabel("Xor PMC par ReLU", fontsize=12) pmc_xor_relu_ax.set_xlabel("XOR PMC par ReLU", fontsize=12)
plt.show() plt.show()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 KiB

After

Width:  |  Height:  |  Size: 536 KiB