From f9e3f3fbd704cdc0b8695ec21120fc1c6393f503 Mon Sep 17 00:00:00 2001 From: Joe Sweeney Date: Wed, 26 Apr 2017 22:50:27 -0400 Subject: [PATCH] Further tweak iterations and move limit --- src/Learn.java | 6 ++--- src/weights/alpha.csv | 53 +++++++++++++++++++++++++++++++++++++++++++ src/weights/beta.csv | 1 + 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/Learn.java b/src/Learn.java index 32b2900..a47f0ff 100644 --- a/src/Learn.java +++ b/src/Learn.java @@ -19,8 +19,8 @@ public class Learn{ // for learning rate, first 30 with .1, next 30 with .05, then final 30 with .01 and see what happens public static void learn(CheckersAI alpha, CheckersAI beta, LearningEvaluator le, BaseEvaluator be){ - final int num_games = 10; - final int iterations = 10; + final int num_games = 5; + final int iterations = 20; Random rand = new Random(); for(int j = 0; j < iterations; j++){ @@ -73,7 +73,7 @@ public class Learn{ int same_moves = 0; Move lastmove = null; Move secondlast = null; - while(!current.isTerminal() && same_moves <= 3 && moves <= 100){ + while(!current.isTerminal() && same_moves <= 3 && moves <= 200){ Move next = alpha.minimax(current, 7); // get alpha's move moves++; if(secondlast != null && next.toString().equals(secondlast.toString())){ diff --git a/src/weights/alpha.csv b/src/weights/alpha.csv index 1193177..f1d7d4b 100644 --- a/src/weights/alpha.csv +++ b/src/weights/alpha.csv @@ -84,3 +84,56 @@ 336.71962563905845, -0.5320673548594255, 3.8219962982772064, 13.36822512157469, -0.6657446401281795, -0.44134064118300914, 7.550932931377796, -5.156863795103834, -6.103690117877966, 3.0399614082526316 339.4348218794906, -1.0502064103884914, 4.020443028437693, 13.83062682189328, -0.49351734987031903, -0.7407966097659485, 8.185699844601078, -3.392158915446407, -5.3800963584425565, 3.957772315384779 342.27182090792905, -0.9927905865477981, 4.119720255856281, 14.185242643900004, -0.6089561304679945, -0.774118543633074, 8.345564840722709, -3.396951536551656, -5.333699599482022, 3.5843331959498226 +313.7075853582476, 30.25033574712875, 3.861133105367109, 13.18974549803267, -0.18831394909459215, -0.5712117559017879, 7.557382643987431, -2.9300054160936235, -4.902251405793945, 2.4374775223258798 +377.84335981640095, 27.007474526310634, 6.03874620039213, 8.805475536648629, 0.5252010808313075, 0.6766317868499717, 3.819616647220618, -9.668195489575906, -8.343883495327919, 1.6883198794870102 +393.11681191354023, 24.090661522218674, 5.663209874673143, 5.303734634325853, 2.7624418995850855, 1.4021675595222196, 4.9057369654347065, -11.585272061522371, -9.854949867667596, 0.02075985310420103 +384.25301377445345, 21.815431021756453, 6.47428539835391, 5.021232335167245, 3.129320097930131, 1.6196592950075552, 3.1288154405844733, -13.111611863540727, -9.104886984147242, -0.3288225105044601 +409.7975212011874, 19.546260721236287, 6.268453428917676, 3.6386549705255, 4.003653491887644, 1.8216621997003992, 3.4019517426292802, -14.16255491913884, -10.450216025416232, -0.22806436487502224 +446.0506512045514, 17.122832628149137, 8.226466431573927, -1.7422609001666105, 4.52388922607928, 2.5295331181984166, 2.3334920274317517, -15.144976009060255, -9.218434363864883, 0.4524162963307161 +503.3097619294297, 15.266039094218172, 7.336682448163374, -5.782406743715486, 4.5741359088357765, 2.627082152100971, 0.5460418085437979, -14.19750792843443, -9.555573245142545, 1.9822048470961 +517.0513518639196, 14.133832153772259, 7.972336699770371, -4.9254042058892145, 3.397415466667729, 2.2603467915841744, -0.06030207779868513, -14.222100616205337, -8.142815892140254, 1.5910881883564694 +342.27182090792905, -0.9927905865477981, 4.119720255856281, 14.185242643900004, -0.6089561304679945, -0.774118543633074, 8.345564840722709, -3.396951536551656, -5.333699599482022, 3.5843331959498226 +335.5323763937658, -0.6454810507077053, 4.02388007131796, 14.40650004068459, 0.16616649318310506, -1.0553939340505554, 8.247790612340026, -1.4093367352402675, -4.851139062910868, 2.7238936207999385 +350.71744577172154, -0.9722509921357618, 4.211096384520958, 14.444303961230636, -0.0040683485623263516, -1.1720772669497914, 8.068655515620264, -1.1187680598619387, -4.459742704590731, 2.0689924854048614 +383.28189647353474, -1.163656413078264, 4.457419748965457, 12.748247480935898, -0.2548322574105584, -0.9881334871779837, 7.2420000614537425, -0.9149857826390115, -5.502797299235051, 3.219788655346874 +393.3782926116969, -1.0104646573313456, 3.3904519891094775, 13.384965117018952, -0.8564473947288336, -0.9601882126674132, 7.572734803397152, -0.9176730574201079, -5.597103320201906, 3.22397269091973 +404.7558783389203, -0.7132656261991845, 2.6730605905674625, 13.018747426998882, -0.7526621669862565, -1.3567129437681094, 7.185001882849098, 1.913923486626972, -3.2191660527341814, 2.9459590338644324 +431.13795474011243, -0.48265797856633863, 4.456485411255982, 11.672252809269965, -0.7957807667638633, -1.1851557093334746, 6.481113150939109, 1.0823028663553096, -3.353733726195592, 2.856617040301504 +438.87634407141303, -0.32490439600692267, 3.547126258085337, 12.14163529386528, -1.1830409359358278, -1.250166930592828, 6.815020437028231, 1.5543351968034906, -2.5711766283136313, 2.424336776005686 +446.39728405292914, -0.09290817216394134, 2.642742757421318, 11.284257925394659, -0.7384934900863636, -0.7940785103701967, 6.449763700980041, 0.12624079798175347, -4.473437424548957, 2.544428424161766 +448.8843665328365, -0.09943130372193723, 2.2076282263418863, 11.197138086171982, -0.7440026067519804, -0.7605868907331612, 6.709134328751352, 0.3278441879640487, -4.530813004062644, 2.3174105277984087 +460.55788776884845, 0.09192740522231363, 1.6324031141862867, 10.989266425417252, -0.8251866986512034, -0.7363615071490033, 6.288599249429883, 0.28590336891437884, -4.561358763371826, 2.1297186246643967 +342.27182090792905, -0.9927905865477981, 4.119720255856281, 14.185242643900004, -0.6089561304679945, -0.774118543633074, 8.345564840722709, -3.396951536551656, -5.333699599482022, 3.5843331959498226 +347.6900166418385, -0.6935744495419813, 4.152616621024113, 13.390263167504466, -0.5371590726445271, -0.6614168427697402, 7.978070282657823, -3.176057792333339, -5.695122095036311, 3.3441437940567207 +383.7406140573895, -1.019970855323232, 3.306243246363169, 9.568586294325346, -0.06764381636822764, -0.4750611447815961, 7.575664707313128, -2.080886558869132, -4.008507964998425, 2.361627542213 +403.9378839298864, -0.7956197275598904, 3.5226936037220513, 7.960761829650588, -0.2583156404140095, -0.35191949074922846, 6.12202900486877, -2.359496303280236, -3.1448677641093266, 1.0562909359705601 +406.25291153385297, -0.6949755435522209, 3.647785367339209, 7.538978520845674, 0.054823607970844235, -0.32786950945687077, 5.925411748686475, -2.2092348136170283, -2.9697144757663065, 0.7718266057346592 +404.8485941752018, -0.45379173456124333, 3.991199579154963, 7.812078261702064, -0.20296584033858245, -0.22713715252508299, 6.929624185253729, -3.6750838119143348, -3.553621560565792, 0.7586188519748734 +413.81882523484387, -0.31762830054289215, 2.9730519798263018, 7.76250943799605, -0.23800851481961535, -0.3098875966194549, 7.4889433390734546, -2.720892732645795, -3.302757746095205, 1.1479645425127742 +399.97697617547726, -0.34418176958017777, 2.740660975655383, 8.899198554150558, 0.05906553255066574, -0.6666024672717346, 7.891505118105878, -0.687579758164464, -2.4431230496781113, 1.3223532163925986 +410.0266526720956, -0.22944232948280863, 2.176524426106762, 8.88895582655686, -0.0460371556693691, -0.6411329277063156, 7.873747344282023, -0.9120364830379855, -2.5212280581667295, 0.8827990722806454 +411.89221544976056, -0.10271008466443124, 1.8215682325695588, 9.344714186658797, -0.21371414340529, -0.5727986181127048, 7.989389307332731, -1.9541440913664228, -2.5603129455033473, 0.6275439708817228 +436.4427529781571, 0.316715342954074, 1.5660697980712261, 5.488293718789496, -0.3344737422730198, -0.38976456001479276, 6.811955864780349, 0.016693649220836715, -0.3350148731074363, 0.3050944612936265 +440.59582290875323, 0.26184235937629724, 1.0983696223873054, 5.052868570326438, -0.16456444971907946, -0.2649445587860011, 6.808955154396271, 0.01177455278621774, -1.0245034000667244, 0.5985641837239217 +408.8742367706895, 0.6446502735209123, 0.574712802586359, 4.698578509582697, 0.6400617266541072, 0.37108643479087433, 6.527210779012496, -3.263678971613557, -4.9374811714718145, -0.3088434230726995 +403.7924943556563, 0.8847470131236823, 0.3033540064195028, 5.438871533979096, 0.36613944613154153, 0.18968937652449003, 7.328204197653186, -2.0800909302961443, -4.771863425060573, -0.03327279028495739 +394.49096218848644, 0.7060950483556417, 0.46630926844880866, 6.719862271706872, 0.16401441593947733, 0.20323805868473785, 8.531886771392175, -3.15232057346625, -5.028884884995114, 0.17633126862528975 +394.45739644174716, 0.7996596785585752, 0.14923455619657278, 6.1321838974939755, 0.18703366536885233, 0.39632852349816916, 9.738853599714641, -4.011043207265446, -5.065002376760053, -0.30099861010768203 +374.17891624728617, 0.025499267614012333, 0.9926087496471051, 7.401763366010737, 0.5060023805494677, -0.2296437141681208, 10.004376159772226, -0.7879194880072724, -3.634829354163566, 3.240488116733258 +391.7662305746847, 0.3752603336319914, 0.06433439286857034, 6.9438945969757535, 0.2078081397025729, -0.3646715918234307, 9.983097361310264, 0.43570319858093165, -2.98108975261946, 3.196012122901985 +423.12891402628554, 0.3636485967971319, 0.6084511997540654, 5.019053967740982, 0.0942144923909212, -0.15632918274646207, 8.152975984136315, -1.5145976138837698, -3.1657580827261733, 1.696849767685504 +428.8064907765869, 0.3214173656843064, 0.5078527345563887, 4.905462186051278, 0.01993118983817388, -0.09877911408349599, 7.885631773841764, -1.889298370628356, -3.548250501302334, 1.5528133889135054 +454.1447784951318, -0.36568813260204874, 0.5881136477010867, 4.697074540561463, 0.34022021539296887, -0.22298446331976385, 7.023505094531618, -1.0296153179974747, -3.581572769434487, 2.3875710861682986 +436.4427529781571, 0.316715342954074, 1.5660697980712261, 5.488293718789496, -0.3344737422730198, -0.38976456001479276, 6.811955864780349, 0.016693649220836715, -0.3350148731074363, 0.3050944612936265 +440.59582290875323, 0.26184235937629724, 1.0983696223873054, 5.052868570326438, -0.16456444971907946, -0.2649445587860011, 6.808955154396271, 0.01177455278621774, -1.0245034000667244, 0.5985641837239217 +408.8742367706895, 0.6446502735209123, 0.574712802586359, 4.698578509582697, 0.6400617266541072, 0.37108643479087433, 6.527210779012496, -3.263678971613557, -4.9374811714718145, -0.3088434230726995 +416.56209214546755, 0.677195947895336, 0.5618428361438204, 3.982126166309692, 0.5919620620352741, 0.5511684596137285, 6.64814786557988, -4.457187889655858, -5.578325936035374, -0.10837167612079013 +427.5100250306357, 0.7587866185630082, 0.10154664871401581, 3.6555594370392663, 0.3985809082824562, 0.5798980200495508, 6.632044605571407, -4.815905423056859, -5.669941676094452, -0.0967394067729837 +437.6044272471472, 0.32725324184918236, 0.3984730309135599, 3.7072725900161876, 0.13749537892949826, 0.34306991121023184, 6.2479615390990455, -4.023356630991852, -5.367149850931073, 0.3309152451530954 +439.40803125719344, 0.8164256615111637, -0.4251440498649285, 4.92836236416913, 0.1406335192593277, 0.27045438046509623, 6.049876358738011, -4.471050226917237, -6.02269711589191, 0.575839070154503 +447.0450487794025, 0.7134067711652301, -0.630350856366874, 2.747614743671488, 0.27862141937851087, 0.7850231860115151, 6.350523295078571, -6.0712583398760485, -7.492327085497011, 0.4080132694490335 +450.92455877932207, 0.2675276824839967, 0.20080125377638514, 2.7459157316748706, 0.33989747679489635, 0.7971271842360697, 6.042708760092609, -6.925471512390524, -7.944966772340889, 0.14435339962838029 +453.92688544900994, 0.4491718150765237, 0.5874617157481802, 3.123074339364655, -0.1458077985616577, 0.6890258385756197, 6.070539908178632, -6.926883052085098, -7.720212581305171, 0.08749774579943081 +453.4814680699587, 0.5888936576633035, 0.5898308249277683, 3.1973840141929957, -0.08194301368714907, 0.710630406050255, 5.84608400140086, -7.400498976694363, -7.500317249224446, -0.17448532893779806 +436.4427529781571, 0.316715342954074, 1.5660697980712261, 5.488293718789496, -0.3344737422730198, -0.38976456001479276, 6.811955864780349, 0.016693649220836715, -0.3350148731074363, 0.3050944612936265 +432.78124466239785, 0.20698702505175914, 2.590021693827257, 5.754817094460199, -0.2647624116081492, -0.4618334974979204, 6.934657584802947, 0.2225946734109353, 0.03128768930766834, 0.5585440774248627 diff --git a/src/weights/beta.csv b/src/weights/beta.csv index e98b019..f46b2a7 100644 --- a/src/weights/beta.csv +++ b/src/weights/beta.csv @@ -1,3 +1,4 @@ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 229.36919365267022, -1.6496020428974534, 3.8805230574440372, 12.407331551622281, 1.3954669824412314, -0.741695394447007, 9.137195051161635, 0.8373839046487954, -1.0319332794259677, 3.4824800608550275 342.27182090792905, -0.9927905865477981, 4.119720255856281, 14.185242643900004, -0.6089561304679945, -0.774118543633074, 8.345564840722709, -3.396951536551656, -5.333699599482022, 3.5843331959498226 +436.4427529781571, 0.316715342954074, 1.5660697980712261, 5.488293718789496, -0.3344737422730198, -0.38976456001479276, 6.811955864780349, 0.016693649220836715, -0.3350148731074363, 0.3050944612936265