Ejemplo n.º 1
0
    def fit(self,
            fit_X,
            fit_y,
            batchsize=100,
            n_epoch=200,
            n_units1=512,
            n_units2=128,
            tv_ratio=0.95,
            optimizerAlgorithm="Adam",
            savefigName="result.pdf",
            savemodelName="ListNet.model"):
        train_X, train_y, validate_X, validate_y = self.splitData(
            fit_X, fit_y, tv_ratio)
        print("The number of data, train:", len(train_X), "validate:",
              len(validate_X))  # 训练和测试数据集表示

        if self.resumemodelName is None:
            self.initializeModel(Model, train_X, n_units1, n_units2,
                                 optimizerAlgorithm)

        self.trainModel(train_X, train_y, validate_X, validate_y, n_epoch,
                        batchsize)

        plot_result.acc(self.train_acc, self.test_acc)
        plot_result.loss(self.train_loss, self.test_loss)
        self.saveModels(savemodelName)
Ejemplo n.º 2
0
    def fit(self, fit_X, fit_y, batchsize=100, n_iter=5000, n_units1=512, n_units2=128, tv_ratio=0.95, optimizerAlgorithm="Adam", savefigName="result1.pdf", savemodelName="RankNet.model"):
        train_X, train_y, validate_X, validate_y = self.splitData(fit_X, fit_y, tv_ratio)
        print("The number of data, train:", len(train_X), "validate:", len(validate_X))

        if self.resumemodelName is None:
            self.initializeModel(Model, train_X, n_units1, n_units2, optimizerAlgorithm)

        self.trainModel(train_X, train_y, validate_X, validate_y, n_iter)

        plot_result.acc(self.train_loss, self.test_loss, savename=savefigName)
        self.saveModels(savemodelName)
Ejemplo n.º 3
0
    def fit(self, fit_X, fit_y, batchsize=100, n_iter=5000, n_units1=512, n_units2=128, tv_ratio=0.95, optimizerAlgorithm="Adam", savefigName="result.pdf", savemodelName="RankNet.model"):
        train_X, train_y, validate_X, validate_y = self.splitData(fit_X, fit_y, tv_ratio)
        print("The number of data, train:", len(train_X), "validate:", len(validate_X))

        if self.resumemodelName is None:
            self.initializeModel(Model, train_X, n_units1, n_units2, optimizerAlgorithm)

        self.trainModel(train_X, train_y, validate_X, validate_y, n_iter)

        plot_result.acc(self.train_loss, self.test_loss, savename=savefigName)
        self.saveModels(savemodelName)
Ejemplo n.º 4
0
    def fit(self, fit_X, fit_y, batchsize=100, n_epoch=200, n_units1=512, n_units2=128, tv_ratio=0.95, optimizerAlgorithm="Adam", savefigName="result.pdf", savemodelName="ListNet.model"):
        train_X, train_y, validate_X, validate_y = self.splitData(fit_X, fit_y, tv_ratio)
        print("The number of data, train:", len(train_X), "validate:", len(validate_X))                # トレーニングとテストのデータ数を表示

        if self.resumemodelName is None:
            self.initializeModel(Model, train_X, n_units1, n_units2, optimizerAlgorithm)
        
        self.trainModel(train_X, train_y, validate_X, validate_y, n_epoch, batchsize)

        plot_result.acc(self.train_acc, self.test_acc)
        plot_result.loss(self.train_loss, self.test_loss)
        self.saveModels(savemodelName)