Merge pull request #3 from titanscout2022/elo

Elo
This commit is contained in:
ltcptgeneral 2019-10-03 11:22:57 -05:00 committed by GitHub
commit 1d3de02763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -7,10 +7,15 @@
# 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.003"
# changelog should be viewed using print(analysis.__changelog__) # changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog: __changelog__ = """changelog:
1.1.2.003:
- fixed elo()
1.1.2.002:
- 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,6 +300,13 @@ def regression_engine(device, inputs, outputs, args, loss = torch.nn.MSELoss(),
return regressions return regressions
@jit(nopython=True)
def elo(starting_score, opposing_scores, observed, N, K):
expected = 1/(1+10**((np.array(opposing_scores) - starting_score)/N))
return starting_score + K*(np.sum(observed) - np.sum(expected))
@jit(forceobj=True) @jit(forceobj=True)
def r_squared(predictions, targets): # assumes equal size inputs def r_squared(predictions, targets): # assumes equal size inputs