From 9e76b6c16018bb8f53995226e8fc0985b6455929 Mon Sep 17 00:00:00 2001 From: Ryan Missel Date: Sun, 31 Mar 2019 09:38:09 -0400 Subject: [PATCH] Auto stash before merge of "master" and "origin/master" --- hypotheses_modeling/model.ckpt | Bin 4443 -> 4443 bytes hypotheses_modeling/pytorch_shit.py | 11 +++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hypotheses_modeling/model.ckpt b/hypotheses_modeling/model.ckpt index 7ab304026c704dccd1c109030959810b233c7987..0668d2848c24e82ddd181f6d85d0cb2347562871 100644 GIT binary patch delta 398 zcmcbubX#e|TV7rxLqk&|b4v>oQ$quj$-j8R5h5n0Mi!If_^u;FEDS6RCOh%F@xXN% znHWxko}@< z8Fq6jbM~91aoT@%H@82rd!k*5TCn|0OHDfksDXEdv-i!J)^2yyf2Cbgc%0oTrJs9E zo!M*`xF*|0-LKf=`$J-1(E;UsEv=mUK8xnr`Mi~~yS9kkE@^tl-nXl!?0aDUa1v;y}y38Aq1xE19`^&*N}?J4V$-w$C3P+xux(`@S0rS+*ya PEw*(`-@JG4A+CJ@TuOzh delta 398 zcmcbubX#e|TV7scLlYANBQs+YV-o|5$-j8R5h5lgW+s#4_^u;FOwA3ACOh%F@xXPN zn3+zV!rxU77XTSk$QZ%Pz`y_(0~u7vgeGQYYF5aMDh4vXkR?@*1E?7U95T}P^SU|g z_qkJQUvQmgf70Vywz}^Z?rWW%y3eC=s~t?;?bY>a`<1y__emu4*q#1hvcGQ0ntf9z zHQK+{f3`20lfjM!VjhEC>b`vy59Rju^>5wRw2jYB0V;k!g<;>~{SNy)Ok(XOZgAUY z>|V03RcVcNtxAR6OCza$4W~|8-@co@&x1?f`kTSeJ&hI@ZCBpv*jJ(@wYT&C>U|aV z8$0&NGoRgO^XSaJyYkI;IvMx(-2Z8?Z-1bbUGtQq``GI5?>*%{(RR`=W4ov+q5FIr TnD_azxY&NKIA!~I_bNL8p$?1+ diff --git a/hypotheses_modeling/pytorch_shit.py b/hypotheses_modeling/pytorch_shit.py index 483c9bc..413aeed 100644 --- a/hypotheses_modeling/pytorch_shit.py +++ b/hypotheses_modeling/pytorch_shit.py @@ -24,7 +24,9 @@ def get_argmax(array): max = array[i] index = i - return [index] + one_hot = [0,0,0,0] + one_hot[index] = 1 + return one_hot def get_trainset(dataset, k, n0, x_columns, y_columns): @@ -71,6 +73,9 @@ def time_series_sigmoid_classification(steps, dataset, k, n0, x_columns, y_colum optimizer = optim.Adam(net.parameters(), lr=.001) loss = nn.CrossEntropyLoss() + x, y = get_trainset(dataset, k, n0, x_columns, y_columns) + accuracy(net, x, y) + for step in range(steps): optimizer.zero_grad() @@ -89,6 +94,8 @@ def time_series_sigmoid_classification(steps, dataset, k, n0, x_columns, y_colum def accuracy(net, x, y): pred = net(x) pred = pred.detach().numpy() + for row in range(len(pred)): + pred[row] = get_argmax(pred[row]) total = len(pred) correct = 0 @@ -110,7 +117,7 @@ def main(): df = pd.read_csv(filename) x = ["day", "playerID", "fatigueSliding"] y = ["day", "playerID", "BestOutOfMyselfAbsolutely", "BestOutOfMyselfSomewhat", "BestOutOfMyselfNotAtAll", "BestOutOfMyselfUnknown"] - time_series_sigmoid_classification(100, df, 0, 30, x, y) + time_series_sigmoid_classification(2, df, 0, 30, x, y) if __name__ == '__main__':