analysis.py v 1.1.2.002

This commit is contained in:
art 2019-10-03 10:42:05 -05:00
parent acdcb42e6d
commit 8801a300c4
2 changed files with 9 additions and 4 deletions

View File

@ -7,10 +7,13 @@
# current benchmark of optimization: 1.33 times faster # current benchmark of optimization: 1.33 times faster
# setup: # setup:
__version__ = "1.1.2.001" __version__ = "1.1.2.002"
# changelog should be viewed using print(analysis.__changelog__) # changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog: __changelog__ = """changelog:
1.1.2.002L
- added elo()
- elo() has bugs to be fixed
1.1.2.001: 1.1.2.001:
- readded regrression import - readded regrression import
1.1.2.000: 1.1.2.000:
@ -295,10 +298,12 @@ def regression_engine(device, inputs, outputs, args, loss = torch.nn.MSELoss(),
return regressions return regressions
#@jit TODO: determine jit type @jit(nopython=True)
def elo(starting_score, observed, N, K): def elo(starting_score, opposing_scores, observed, N, K):
pass expected = 1/(1+10**((np.array(opposing_scores) - starting_score)/N))
return starting_score + K*(np.sum(expected) - np.sum(observed))
@jit(forceobj=True) @jit(forceobj=True)
def r_squared(predictions, targets): # assumes equal size inputs def r_squared(predictions, targets): # assumes equal size inputs