{"id":3148,"date":"2020-07-30T10:32:20","date_gmt":"2020-07-30T08:32:20","guid":{"rendered":"http:\/\/entropie.org\/3615\/?p=3148"},"modified":"2021-03-02T01:56:43","modified_gmt":"2021-03-02T00:56:43","slug":"puissance-4-en-python-nouvelle-competition","status":"publish","type":"post","link":"https:\/\/entropie.org\/3615\/index.php\/2020\/07\/30\/puissance-4-en-python-nouvelle-competition\/","title":{"rendered":"Puissance 4 en Python : Nouvelle comp\u00e9tition"},"content":{"rendered":"<div style=\"width: 840px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-3148-1\" width=\"840\" height=\"473\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/entropie.org\/3615\/wp-content\/uploads\/2020\/07\/puissance-4.mp4?_=1\" \/><a href=\"https:\/\/entropie.org\/3615\/wp-content\/uploads\/2020\/07\/puissance-4.mp4\">https:\/\/entropie.org\/3615\/wp-content\/uploads\/2020\/07\/puissance-4.mp4<\/a><\/video><\/div>\n<p>L\u2019objectif \u00e9tait de mettre au point une intelligence artificielle (IA) la meilleure possible pour jouer \u00e0 Puissance 4, sans descendre en profondeur dans un arbre comme avec l\u2019algorithme minimax ou alpha-b\u00eata. Je pense \u00eatre tr\u00e8s pr\u00e8s du but avec <span style=\"color:#ffff00;\">IA15<\/span> bien que l&rsquo;IA en question soit encore facile \u00e0 battre pour un humain. Va d\u00e9sormais venir le temps des arbres, puis de l\u2019apprentissage&#8230;<\/p>\n<p><strong>Pr\u00e9sentation des IA<\/strong> :<\/p>\n<p><u>Codage de la strat\u00e9gie<\/u> :<\/p>\n<p><strong><span style=\"color:#00ff00;\">H<\/span><\/strong> veut dire <strong><span style=\"color:#00ff00;\">H<\/span>asard<\/strong><br \/>\n<strong><span style=\"color:#00ff00;\">P<\/span><\/strong> veut dire <strong><span style=\"color:#00ff00;\">P<\/span>oids des cases<\/strong> (il y a plus de possibilit\u00e9s d&rsquo;alignements pour certaines cases)<br \/>\n<strong><span style=\"color:#00ff00;\">AX<\/span><\/strong> veut dire <strong><span style=\"color:#00ff00;\">A<\/span>lignement de <span style=\"color:#00ff00;\">X<\/span> pions<\/strong> (l\u2019IA essaye d&rsquo;aligner X pions ; les alignements \u00ab trou\u00e9s \u00bb de 2 ou 3 pions sont pris en compte)<br \/>\n<strong><span style=\"color:#00ff00;\">BX<\/span><\/strong> veut dire <strong><span style=\"color:#00ff00;\">B<\/span>locage de <span style=\"color:#00ff00;\">X<\/span> pions<\/strong> (l\u2019IA essaye d&#8217;emp\u00eacher l&rsquo;adversaire d&rsquo;aligner X pions ; les alignements \u00ab trou\u00e9s \u00bb de 2 ou 3 pions sont pris en compte)<\/p>\n<p>Le codage des IA en comp\u00e9tition est :<\/p>\n<p>IA0 : Priorit\u00e9 <span style=\"color:#00ff00;\">H<\/span><br \/>\nIA1 : Priorit\u00e9 <span style=\"color:#00ff00;\">PH<\/span><br \/>\nIA12 : Priorit\u00e9s <span style=\"color:#00ff00;\">A4PH \/ A3PH \/ A2PH \/ PH<\/span><br \/>\nIA13 : Priorit\u00e9s <span style=\"color:#00ff00;\">B4PH \/ B3PH \/ B2PH \/ PH<\/span><br \/>\nIA14 : Priorit\u00e9s <span style=\"color:#00ff00;\">A4PH \/ B4PH \/ A3PH \/ B3PH \/ A2PH \/ B2PH \/ PH<\/span><br \/>\nIA15 : Priorit\u00e9s <span style=\"color:#00ff00;\">A4PH \/ B4PH \/ A3PH \/ B3PH \/ B2PH \/ A2PH \/ PH<\/span><br \/>\nIA16 : Priorit\u00e9s <span style=\"color:#00ff00;\">A4PH \/ B4PH \/ B3PH \/ A3PH \/ A2PH \/ B2PH \/ PH<\/span><br \/>\nIA17 : Priorit\u00e9s <span style=\"color:#00ff00;\">A4PH \/ B4PH \/ B3PH \/ A3PH \/ B2PH \/ A2PH \/ PH<\/span><br \/>\nIA18 : Priorit\u00e9s <span style=\"color:#00ff00;\">A4PH \/ B4PH \/ A2PH \/ B2PH \/ PH<\/span><br \/>\nIA19 : Priorit\u00e9s <span style=\"color:#00ff00;\">A4PH \/ B4PH \/ B2PH \/ A2PH \/ PH<\/span><br \/>\nIA20 : Priorit\u00e9s <span style=\"color:#00ff00;\">A4PH \/ B4PH \/ B3PH \/ B2PH \/ A3PH \/ A2PH \/ PH<\/span><\/p>\n<p><u>Pr\u00e9sentation des r\u00e9sultats<\/u> :<\/p>\n<p>Sur 1 million de parties, les r\u00e9sultats bruts sont :<\/p>\n<p>IA0 \/ IA0 \/ Nulles : 499 231 \/ 498 300 \/ 2 469<br \/>\n<span style=\"color:#ffff00;\">IA1<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">878 716<\/span> \/ 121 257 \/ 27<br \/>\n<span style=\"color:#ffff00;\">IA12<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">970 480<\/span> \/ 29 520 \/ 0<br \/>\n<span style=\"color:#ffff00;\">IA13<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">967 884<\/span> \/ 18 236 \/ 13 880<br \/>\n<span style=\"color:#ffff00;\">IA14<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">996 952<\/span> \/ 3 034 \/ 14<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">995 524<\/span> \/ 4 369 \/ 107<br \/>\n<span style=\"color:#ffff00;\">IA16<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">993 656<\/span> \/ 6 191 \/ 153<br \/>\n<span style=\"color:#ffff00;\">IA17<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">993 568<\/span> \/ 5 938 \/ 494<br \/>\n<span style=\"color:#ffff00;\">IA18<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">992 092<\/span> \/ 7 886 \/ 22<br \/>\n<span style=\"color:#ffff00;\">IA19<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">988 123<\/span> \/ 11 735 \/ 142<br \/>\n<span style=\"color:#ffff00;\">IA20<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">991 937<\/span> \/ 7 195 \/ 868<\/p>\n<p><span style=\"color:#ffff00;\">IA15<\/span> \/ IA0 \/ Nulles : <span style=\"color:#ffff00;\">995 524<\/span> \/ 4 369 \/ 107<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA1 \/ Nulles : <span style=\"color:#ffff00;\">979 122<\/span> \/ 0 \/ 20 878<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA12 \/ Nulles : <span style=\"color:#ffff00;\">1 000 000<\/span> \/ 0 \/ 0<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA13 \/ Nulles : <span style=\"color:#ffff00;\">724 198<\/span> \/ 266 561 \/ 9 241<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA14 \/ Nulles : <span style=\"color:#ffff00;\">1 000 000<\/span> \/ 0 \/ 0<br \/>\nIA15 \/ IA15 \/ Nulles : 500 000 \/ 500 000 \/ 0<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA16 \/ Nulles : <span style=\"color:#ffff00;\">1 000 000<\/span> \/ 0 \/ 0<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA17 \/ Nulles : <span style=\"color:#ffff00;\">1 000 000<\/span> \/ 0 \/ 0<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA18 \/ Nulles : <span style=\"color:#ffff00;\">771 989<\/span> \/ 228 011 \/ 0<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA19 \/ Nulles : <span style=\"color:#ffff00;\">746 678<\/span> \/ 0 \/ 253 322<br \/>\n<span style=\"color:#ffff00;\">IA15<\/span> \/ IA20 \/ Nulles : <span style=\"color:#ffff00;\">723 979<\/span> \/ 266 779 \/ 9 242<\/p>\n<p><u>Commentaires<\/u> :<\/p>\n<p>Si on compare IA14 et IA15, il n&rsquo;y a qu&rsquo;une seule inversion dans le codage de la strat\u00e9gie&nbsp;: on passe de <span style=\"color:#00ff00;\">A2PH \/ B2PH<\/span> pour IA14 \u00e0 <span style=\"color:#00ff00;\">B2PH \/ A2PH<\/span> pour IA15 et l&rsquo;effet est radical&nbsp;: IA15 \u00e9crase IA14. De m\u00eame, si on compare IA15 et IA17, on passe de <span style=\"color:#00ff00;\">A3PH \/ B3PH<\/span> pour IA15 \u00e0 <span style=\"color:#00ff00;\">B3PH \/ A3PH<\/span> pour IA17 et l&rsquo;effet est radical&nbsp;: IA17 est \u00e9cras\u00e9e par IA15.<\/p>\n<p>Code source sur <a href=\"https:\/\/github.com\/eserandour\/Puissance_4\" rel=\"noopener noreferrer\" target=\"_blank\">GitHub<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>L\u2019objectif \u00e9tait de mettre au point une intelligence artificielle (IA) la meilleure possible pour jouer \u00e0 Puissance 4, sans descendre en profondeur dans un arbre comme avec l\u2019algorithme minimax ou alpha-b\u00eata. Je pense \u00eatre tr\u00e8s pr\u00e8s du but avec IA15 bien que l&rsquo;IA en question soit encore facile \u00e0 battre pour un humain. Va d\u00e9sormais &hellip; <a href=\"https:\/\/entropie.org\/3615\/index.php\/2020\/07\/30\/puissance-4-en-python-nouvelle-competition\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Puissance 4 en Python : Nouvelle comp\u00e9tition&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,33,21],"tags":[],"class_list":["post-3148","post","type-post","status-publish","format-standard","hentry","category-intelligence-artificielle","category-puissance-4","category-python"],"_links":{"self":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts\/3148"}],"collection":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/comments?post=3148"}],"version-history":[{"count":81,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts\/3148\/revisions"}],"predecessor-version":[{"id":3748,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts\/3148\/revisions\/3748"}],"wp:attachment":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/media?parent=3148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/categories?post=3148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/tags?post=3148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}