from util.better_abc import ABCMeta, abstract_attribute


class TrainConfig(metaclass=ABCMeta):
    batch_size = abstract_attribute()
    num_iterations = abstract_attribute()
    learning_rate = abstract_attribute()
    print_freq = abstract_attribute()
    valid_freq = abstract_attribute()
    patience = abstract_attribute()
    num_data_loader_workers = abstract_attribute()


class IntentionTrainConfig(TrainConfig):
    batch_size = 64
    num_iterations = 10000
    learning_rate = 0.0001
    print_freq = 100
    # print_freq = 2
    valid_freq = 1000
    patience = 5
    num_data_loader_workers = 5


class TextTrainConfig(TrainConfig):
    # batch_size = 64
    batch_size = 16 #16#32#16#8#32#8#16#4#16# 4#8#1#4#8#16#32#8#16 #32 #64 #32 16
    num_iterations = 100 #10000
    # num_iterations = 900
    # learning_rate = 0.00001 # 0.0001 0.00001
    # learning_rate = 0.001 # 0.0001 0.00001 0.0001
    learning_rate = 1e-5 #5e-6 #5e-5 #0.0001 #0.00001 #0.005 # 0.0001 #0.001 #0.1 #0.01 # 0.001 # 0.0001 0.00001 0.0001 0.01 # 0.001
    # print_freq = 1 #100
    print_freq = 100 #100--1
    # print_freq = 1
    # valid_freq = 1000
    valid_freq = 400 #10 # 100 50 20 5 30 40
    # valid_freq = 1
    # patience = 20 #20 50
    patience = 50
    num_data_loader_workers = 5


class RecommendTrainConfig(TrainConfig):
    batch_size = 64
    num_iterations = 10000
    learning_rate = 0.0001
    print_freq = 100
    valid_freq = 1000
    patience = 5
    num_data_loader_workers = 5


class KnowledgeStyletipTrainConfig(TrainConfig):
    batch_size = 64
    num_iterations = 10000
    learning_rate = 0.00004
    print_freq = 100
    valid_freq = 1000
    patience = 20
    num_data_loader_workers = 5


class KnowledgeAttributeTrainConfig(TrainConfig):
    batch_size = 64
    num_iterations = 10000
    learning_rate = 0.0004
    print_freq = 100
    valid_freq = 1000
    patience = 20
    num_data_loader_workers = 5


class KnowledgeCelebrityTrainConfig(TrainConfig):
    batch_size = 64
    num_iterations = 10000
    learning_rate = 0.0004
    print_freq = 100
    valid_freq = 1000
    patience = 20
    num_data_loader_workers = 5
