Check if train kernel is benifit to pretrain.
This commit is contained in:
parent
8a9acaa94e
commit
c2e149fb68
|
@ -44,7 +44,8 @@ batchsize = 128
|
||||||
# traindata, testdata = Loader.RandomMnist(batchsize, num_workers=4, style="Horizontal")
|
# traindata, testdata = Loader.RandomMnist(batchsize, num_workers=4, style="Horizontal")
|
||||||
# traindata, testdata = Loader.RandomMnist(batchsize, num_workers=4, style="VerticalOneLine")
|
# traindata, testdata = Loader.RandomMnist(batchsize, num_workers=4, style="VerticalOneLine")
|
||||||
# traindata, testdata = Loader.RandomMnist(batchsize, num_workers=4, style="VerticalZebra")
|
# traindata, testdata = Loader.RandomMnist(batchsize, num_workers=4, style="VerticalZebra")
|
||||||
traindata, testdata = Loader.Cifar10Mono(batchsize, num_workers=4,shuffle=True,trainsize=500)
|
# traindata, testdata = Loader.Cifar10Mono(batchsize, num_workers=4,shuffle=True,trainsize=500)
|
||||||
|
traindata, testdata = Loader.Cifar10Mono(batchsize, num_workers=4,shuffle=True,trainsize=0)
|
||||||
|
|
||||||
|
|
||||||
WebVisual.InitVisdom()
|
WebVisual.InitVisdom()
|
||||||
|
@ -57,10 +58,10 @@ linePretrainTrain = WebVisual.Line(window, "PretrainTrain")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# model = utils.SetDevice(Model.Net3Grad335())
|
model = utils.SetDevice(Model.Net3Grad335())
|
||||||
# model = utils.LoadModel(model, CurrentPath+"/checkpointTrain.pkl")
|
model = utils.LoadModel(model, CurrentPath+"/checkpointTrain.pkl")
|
||||||
# optimizer = optim.SGD(model.parameters(), lr=0.1)
|
optimizer = optim.SGD(model.parameters(), lr=0.1)
|
||||||
# Train.TrainEpochs(model,traindata,optimizer,testdata,3000,30,linePretrainTrain)
|
Train.TrainEpochs(model,traindata,optimizer,testdata,3000,30,linePretrainTrain)
|
||||||
|
|
||||||
|
|
||||||
model = utils.SetDevice(Model.Net3335())
|
model = utils.SetDevice(Model.Net3335())
|
||||||
|
@ -69,10 +70,12 @@ optimizer = optim.SGD(model.parameters(), lr=0.1)
|
||||||
Train.TrainEpochs(model,traindata,optimizer,testdata,3000,30,lineNoPre)
|
Train.TrainEpochs(model,traindata,optimizer,testdata,3000,30,lineNoPre)
|
||||||
|
|
||||||
|
|
||||||
model = utils.SetDevice(Model.Net3Grad335())
|
# model = utils.SetDevice(Model.Net3Grad335())
|
||||||
model = utils.LoadModel(model, CurrentPath+"/checkpointSearch.pkl")
|
# model = utils.LoadModel(model, CurrentPath+"/checkpointSearch.pkl")
|
||||||
optimizer = optim.SGD(model.parameters(), lr=0.1)
|
# optimizer = optim.SGD(model.parameters(), lr=0.1)
|
||||||
Train.TrainEpochs(model,traindata,optimizer,testdata,3000,30,linePretrainSearch)
|
# Train.TrainEpochs(model,traindata,optimizer,testdata,3000,30,linePretrainSearch)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue