예제 #1
0
    def on_train_begin(self, logs={}):

        self.train_loss = []
        self.auc = []
        self.logits = []
        self.val_loss = []

        # save json representation
        model_json = self.model.to_json()
        with open("/home/ahmed/output/" + RUN + "_json.json",
                  "w") as json_file:
            json_file.write(model_json)

        dataFrameTrain, dataFrameValidate, dataFrameTest = manageDataFrames()
        #
        x_val, y_val, zeros, ones = getXandY(dataFrameValidate, imgSize)
        print("validation data:", x_val.shape, y_val.shape, zeros, ones)
        self.dataFrameValidate = dataFrameValidate
        self.y_val = y_val
        # lets do featurewiseCenterAndStd - its still a cube at this point
        # x_val_cs = centerAndStandardizeValTest(x_val,mean,std)
        x_val_cs = centerAndNormalize(x_val)
        # x_val_cs = x_val

        if fork:
            # lets get the 3 orientations
            self.x_val_a, self.x_val_s, self.x_val_c = krs.splitValTest(
                x_val_cs, finalSize, imgSize, count, mode, fork, skip)
            print("final val data:", self.x_val_a.shape, self.x_val_s.shape,
                  self.x_val_c.shape)

        else:
            # lets get one only
            self.x_val = krs.splitValTest(x_val_cs, finalSize, imgSize, count,
                                          mode, fork, skip)
            print("final val data:", x_val.shape)

        return
예제 #2
0
#
#

dataFrameTest, dataFrameValidate, dataFrameTest = funcs.manageDataFrames()

x_test = funcs.getX(dataFrameTest, imgSize)
print("test data:", x_test.shape)

# center and standardize
# x_test_cs = funcs.centerAndStandardizeValTest(x_test,mean,std)
x_test_cs = funcs.centerAndNormalize(x_test)

if fork:
    # lets get the 3 orientations
    x_test_a, x_test_s, x_test_c = krs.splitValTest(x_test_cs, finalSize,
                                                    imgSize, count, mode, fork,
                                                    skip)
    print("final val data:", x_test_a.shape, x_test_s.shape, x_test_c.shape)

else:
    x_test = krs.splitValTest(x_test_cs, finalSize, imgSize, count, mode, fork,
                              skip)
    print("final val data:", x_test.shape)

#
#
#       .g8"""bgd `7MM"""YMM MMP""MM""YMM     `7MMM.     ,MMF' .g8""8q. `7MM"""Yb. `7MM"""YMM  `7MMF'
#     .dP'     `M   MM    `7 P'   MM   `7       MMMb    dPMM .dP'    `YM. MM    `Yb. MM    `7    MM
#     dM'       `   MM   d        MM            M YM   ,M MM dM'      `MM MM     `Mb MM   d      MM
#     MM            MMmmMM        MM            M  Mb  M' MM MM        MM MM      MM MMmmMM      MM
#     MM.    `7MMF' MM   Y  ,     MM            M  YM.P'  MM MM.      ,MP MM     ,MP MM   Y  ,   MM      ,