const { DataTypes } = require('sequelize');
const sequelize = require('../database/database.js');

const Training = sequelize.define('training', {
    id: {
        type: DataTypes.INTEGER,
        autoIncrement: true,
        unique: true,
        primaryKey: true
    },
    exp_name: {
        type: DataTypes.STRING(255)
    },
    max_epoch: {
        type: DataTypes.INTEGER
    },
    depth: {
        type: DataTypes.FLOAT
    },
    width: {
        type: DataTypes.FLOAT
    },
    activation: {
        type: DataTypes.STRING(255)
    },
    warmup_epochs: {
        type: DataTypes.INTEGER
    },
    warmup_lr: {
        type: DataTypes.FLOAT
    },
    basic_lr_per_img: {
        type: DataTypes.FLOAT
    },
    scheduler: {
        type: DataTypes.STRING(255)
    },
    no_aug_epochs: {
        type: DataTypes.INTEGER
    },
    min_lr_ratio: {
        type: DataTypes.FLOAT
    },
    ema: {
        type: DataTypes.BOOLEAN
    },
    weight_decay: {
        type: DataTypes.FLOAT
    },
    momentum: {
        type: DataTypes.FLOAT
    },
    input_size: {
        type: DataTypes.JSON
    },
    print_interval: {
        type: DataTypes.INTEGER
    },
    eval_interval: {
        type: DataTypes.INTEGER
    },
    save_history_ckpt: {
        type: DataTypes.BOOLEAN
    },
    test_size: {
        type: DataTypes.JSON
    },
    test_conf: {
        type: DataTypes.FLOAT
    },
    nms_thre: {
        type: DataTypes.FLOAT
    },
    multiscale_range: {
        type: DataTypes.INTEGER
    },
    enable_mixup: {
        type: DataTypes.BOOLEAN
    },
    mosaic_prob: {
        type: DataTypes.FLOAT
    },
    mixup_prob: {
        type: DataTypes.FLOAT
    },
    hsv_prob: {
        type: DataTypes.FLOAT
    },
    flip_prob: {
        type: DataTypes.FLOAT
    },
    degrees: {
        type: DataTypes.FLOAT
    },
    mosaic_scale: {
        type: DataTypes.JSON
    },
    mixup_scale: {
        type: DataTypes.JSON
    },
    translate: {
        type: DataTypes.FLOAT
    },
    shear: {
        type: DataTypes.FLOAT
    },
    training_name: {
        type: DataTypes.STRING(255)
    },
    project_details_id: {
        type: DataTypes.INTEGER,
        allowNull: false
    },
    seed: {
        type: DataTypes.INTEGER
    },
    train: {
        type: DataTypes.INTEGER
    },
    valid: {
        type: DataTypes.INTEGER
    },
    test: {
        type: DataTypes.INTEGER
    },
    selected_model: {
        type: DataTypes.STRING(255)
    },
    transfer_learning: {
        type: DataTypes.STRING(255)
    },
    model_upload: {
        type: DataTypes.BLOB
    }
}, {
    tableName: 'training',
    timestamps: false
});

module.exports = Training;
