def __init__(self): QWidget.__init__(self) self.layout = QVBoxLayout() SET_HYPERPARAMETER("diffLatentSpace", latentSpace) self.data = np.load("./npz/diffs.npz")["arr_1"] self.codes = np.load(codeNpz)["arr_1"] self.maxs = np.max(self.codes, axis=0) self.mins = np.min(self.codes, axis=0) self.model = model.emptyModel(restore + "_visual", inputsShape=list(self.data.shape[1:]), use="diff", log=False) self.model.restore(restore) self.setLayout(self.layout) self.setWindowTitle("JTEKT encoder visualization") self.sliders = [] for idx in range(latentSpace): self.sliders.append( Slider(self, idx, self.maxs[idx], self.mins[idx])) self.render = Render(self) self.update()
import numpy as np import model from model import SET_HYPERPARAMETER SET_HYPERPARAMETER("diffLatentSpace", 6) data = np.load("./npz/diffs.npz")["arr_1"] model = model.emptyModel("DIFF_17jan_ls6_g", inputsShape=list(data.shape[1:]), use="diff", log=False) model.restore("DIFF_17jan_ls6_f") code = [[0, 0, 0, 0, 0, 0]] result = model.generate(code, data[0:1]) print(result) print(result.shape)
import model import numpy as np from model import SET_HYPERPARAMETER SET_HYPERPARAMETER("contrast", 50.0) SET_HYPERPARAMETER("diffLatentSpace", 30) data = np.load("./npz/diffsWithNames.npz") goods = data["arr_0"] bads = data["arr_1"] model = model.emptyModel("generateSmoothDiff", inputsShape=list(goods[0].shape), use="diff", log=False) model.restore("28jan_ls30") trainDiffs = model.reproduce(goods) testDiffs = model.reproduce(bads) np.savez("./npz/smoothDiffsWithNames_ls30.npz", trainDiffs, testDiffs, data["arr_2"], data["arr_3"])
import model import numpy as np from model import SET_HYPERPARAMETER SET_HYPERPARAMETER("contrast", 300.0) SET_HYPERPARAMETER("learningRate", 0.0005) SET_HYPERPARAMETER("diffLatentSpace", 5) SET_HYPERPARAMETER("normalize", "individual") files = np.load("./npz/diffsWithNames.npz") goods = files["arr_0"] bads = files["arr_1"] data = np.concatenate([bads, goods]) model = model.emptyModel("5feb-ls5-inorm_f", inputsShape=list(data.shape[1:]), use="diff") model.restore("5feb-ls5-inorm_e") model.train(epoch=100, dataset=data) model.save()
import model import numpy as np from model import SET_HYPERPARAMETER SET_HYPERPARAMETER("contrast", 300.0) SET_HYPERPARAMETER("diffLatentSpace", 12) SET_HYPERPARAMETER("normalize", "individual") data = np.load("./npz/diffsWithNames.npz") goods = data["arr_0"] bads = data["arr_1"] model = model.emptyModel("generateEncode", use="diff", log=False, inputsShape=list(goods[0].shape)) model.restore("5feb-ls12-inorm_d") testEncoded = model.encode(bads) trainEncoded = model.encode(goods) np.savez("./npz/codesWithNames_inorm.npz", trainEncoded, testEncoded, data["arr_2"], data["arr_3"])
import model import numpy as np from model import SET_HYPERPARAMETER SET_HYPERPARAMETER("latentSpace", 1) data = np.load("./npz/dataWithNames.npz") goods = data["arr_0"] bads = data["arr_1"] model = model.emptyModel("generateDiff", inputsShape=list(goods[0].shape), log=False, use="jtekt") model.restore("4feb-ls1") trainDiffs = model.getDiff(goods) testDiffs = model.getDiff(bads) np.savez("./npz/diffsWithNames.npz", trainDiffs, testDiffs, data["arr_2"], data["arr_3"])
import model import numpy as np from model import SET_HYPERPARAMETER SET_HYPERPARAMETER("learningRate", 0.001) SET_HYPERPARAMETER("latentSpace", 1) goods = np.load("./npz/dataWithNames.npz")["arr_0"] bads = np.load("./npz/dataWithNames.npz")["arr_1"] data = np.concatenate([bads, goods]) model = model.emptyModel("4feb-ls1", inputsShape=list(data.shape[1:]), use="jtekt") #model.restore("16jan-ls3") model.train(epoch=20, dataset=data) model.save()