mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-13 22:56:18 +00:00
jacob fix poly regression!
This commit is contained in:
parent
c824087335
commit
f47be637a0
Binary file not shown.
@ -262,26 +262,26 @@ def regression(device, inputs, outputs, args, loss = torch.nn.MSELoss(), _iterat
|
|||||||
if 'lin' in args:
|
if 'lin' in args:
|
||||||
|
|
||||||
model = Regression.SGDTrain(Regression.LinearRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float).cuda(), torch.tensor([outputs]).to(torch.float).cuda(), iterations=_iterations, learning_rate=lr, return_losses=True)
|
model = Regression.SGDTrain(Regression.LinearRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float).cuda(), torch.tensor([outputs]).to(torch.float).cuda(), iterations=_iterations, learning_rate=lr, return_losses=True)
|
||||||
regressions.append([model[0].parameters, model[1][::-1][0]])
|
regressions.append((model[0].parameters, model[1][::-1][0]))
|
||||||
|
|
||||||
if 'log' in args:
|
if 'log' in args:
|
||||||
|
|
||||||
model = Regression.SGDTrain(Regression.LogRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float).cuda(), torch.tensor(outputs).to(torch.float).cuda(), iterations=_iterations, learning_rate=lr, return_losses=True)
|
model = Regression.SGDTrain(Regression.LogRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float).cuda(), torch.tensor(outputs).to(torch.float).cuda(), iterations=_iterations, learning_rate=lr, return_losses=True)
|
||||||
regressions.append([model[0].parameters, model[1][::-1][0]])
|
regressions.append((model[0].parameters, model[1][::-1][0]))
|
||||||
|
|
||||||
if 'exp' in args:
|
if 'exp' in args:
|
||||||
|
|
||||||
model = Regression.SGDTrain(Regression.ExpRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float).cuda(), torch.tensor(outputs).to(torch.float).cuda(), iterations=_iterations, learning_rate=lr, return_losses=True)
|
model = Regression.SGDTrain(Regression.ExpRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float).cuda(), torch.tensor(outputs).to(torch.float).cuda(), iterations=_iterations, learning_rate=lr, return_losses=True)
|
||||||
regressions.append([model[0].parameters, model[1][::-1][0]])
|
regressions.append((model[0].parameters, model[1][::-1][0]))
|
||||||
|
|
||||||
#if 'poly' in args:
|
#if 'ply' in args:
|
||||||
|
|
||||||
#TODO because Jacob hasnt fixed regression.py
|
#TODO because Jacob hasnt fixed regression.py
|
||||||
|
|
||||||
if 'sig' in args:
|
if 'sig' in args:
|
||||||
|
|
||||||
model = Regression.SGDTrain(Regression.SigmoidalRegKernelArthur(len(inputs)), torch.tensor(inputs).to(torch.float).cuda(), torch.tensor(outputs).to(torch.float).cuda(), iterations=_iterations, learning_rate=lr, return_losses=True)
|
model = Regression.SGDTrain(Regression.SigmoidalRegKernelArthur(len(inputs)), torch.tensor(inputs).to(torch.float).cuda(), torch.tensor(outputs).to(torch.float).cuda(), iterations=_iterations, learning_rate=lr, return_losses=True)
|
||||||
regressions.append([model[0].parameters, model[1][::-1][0]])
|
regressions.append((model[0].parameters, model[1][::-1][0]))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
@ -290,26 +290,26 @@ def regression(device, inputs, outputs, args, loss = torch.nn.MSELoss(), _iterat
|
|||||||
if 'linear' in args:
|
if 'linear' in args:
|
||||||
|
|
||||||
model = Regression.SGDTrain(Regression.LinearRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float), torch.tensor(outputs).to(torch.float), iterations=_iterations, learning_rate=lr, return_losses=True)
|
model = Regression.SGDTrain(Regression.LinearRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float), torch.tensor(outputs).to(torch.float), iterations=_iterations, learning_rate=lr, return_losses=True)
|
||||||
regressions.append([model[0].parameters, model[1][::-1][0]])
|
regressions.append((model[0].parameters, model[1][::-1][0]))
|
||||||
|
|
||||||
if 'log' in args:
|
if 'log' in args:
|
||||||
|
|
||||||
model = Regression.SGDTrain(Regression.LogRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float), torch.tensor(outputs).to(torch.float), iterations=_iterations, learning_rate=lr, return_losses=True)
|
model = Regression.SGDTrain(Regression.LogRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float), torch.tensor(outputs).to(torch.float), iterations=_iterations, learning_rate=lr, return_losses=True)
|
||||||
regressions.append([model[0].parameters, model[1][::-1][0]])
|
regressions.append((model[0].parameters, model[1][::-1][0]))
|
||||||
|
|
||||||
if 'exp' in args:
|
if 'exp' in args:
|
||||||
|
|
||||||
model = Regression.SGDTrain(Regression.ExpRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float), torch.tensor(outputs).to(torch.float), iterations=_iterations, learning_rate=lr, return_losses=True)
|
model = Regression.SGDTrain(Regression.ExpRegKernel(len(inputs)), torch.tensor(inputs).to(torch.float), torch.tensor(outputs).to(torch.float), iterations=_iterations, learning_rate=lr, return_losses=True)
|
||||||
regressions.append([model[0].parameters, model[1][::-1][0]])
|
regressions.append((model[0].parameters, model[1][::-1][0]))
|
||||||
|
|
||||||
#if 'poly' in args:
|
#if 'ply' in args:
|
||||||
|
|
||||||
#TODO because Jacob hasnt fixed regression.py
|
#TODO because Jacob hasnt fixed regression.py
|
||||||
|
|
||||||
if 'sig' in args:
|
if 'sig' in args:
|
||||||
|
|
||||||
model = Regression.SGDTrain(Regression.SigmoidalRegKernelArthur(len(inputs)), torch.tensor(inputs).to(torch.float), torch.tensor(outputs).to(torch.float), iterations=_iterations, learning_rate=lr, return_losses=True)
|
model = Regression.SGDTrain(Regression.SigmoidalRegKernelArthur(len(inputs)), torch.tensor(inputs).to(torch.float), torch.tensor(outputs).to(torch.float), iterations=_iterations, learning_rate=lr, return_losses=True)
|
||||||
regressions.append([model[0].parameters, model[1][::-1][0]])
|
regressions.append((model[0].parameters, model[1][::-1][0]))
|
||||||
|
|
||||||
return regressions
|
return regressions
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user