# Path: keras_image_captioning/common_utils.py
# def parse_timedelta(timedelta_str):
#     if isinstance(timedelta_str, timedelta):
#         return timedelta_str
#     if not timedelta_str or timedelta_str == 'null':
#         return None
# 
#     tokens = re.split(r' days?,? ', timedelta_str)
#     if len(tokens) == 1:
#         if tokens[0].find('day') == -1:
#             days = '0'
#             rest = tokens[0]
#         else:
#             days = tokens[0].split(' ')[0]
#             rest = '00:00:00'
#     else:
#         days, rest = tokens
# 
#     days = int(days)
#     hours, minutes, seconds = map(int, rest.split(':'))
#     return timedelta(days=days, hours=hours, minutes=minutes, seconds=seconds)
# 
# Path: keras_image_captioning/io_utils.py
# def write_yaml_file(obj, path):
#     with open(path, 'w') as f:
#         yaml.dump(obj, f, default_flow_style=False)


import itertools
import yaml
import sys
from collections import OrderedDict, namedtuple
from datetime import timedelta
from random import choice, randint, uniform
from .common_utils import parse_timedelta
from .io_utils import write_yaml_file



# List of all available hyperparameters
Config = namedtuple('Config', '''
    dataset_name
    epochs
    time_limit
    batch_size

    reduce_lr_factor
    reduce_lr_patience
    early_stopping_patience

    lemmatize_caption
    rare_words_handling
    words_min_occur

    learning_rate
    vocab_size
    embedding_size
    rnn_output_size
    dropout_rate

    bidirectional_rnn
    rnn_type
    rnn_layers

    l1_reg

# Path: keras_image_captioning/common_utils.py
# def parse_timedelta(timedelta_str):
#     if isinstance(timedelta_str, timedelta):
#         return timedelta_str
#     if not timedelta_str or timedelta_str == 'null':
#         return None
# 
#     tokens = re.split(r' days?,? ', timedelta_str)
#     if len(tokens) == 1:
#         if tokens[0].find('day') == -1:
#             days = '0'
#             rest = tokens[0]
#         else:
#             days = tokens[0].split(' ')[0]
#             rest = '00:00:00'
#     else:
#         days, rest = tokens
# 
#     days = int(days)
#     hours, minutes, seconds = map(int, rest.split(':'))
#     return timedelta(days=days, hours=hours, minutes=minutes, seconds=seconds)
# 
# Path: keras_image_captioning/io_utils.py
# def write_yaml_file(obj, path):
#     with open(path, 'w') as f:
#         yaml.dump(obj, f, default_flow_style=False)


# Path: keras_image_captioning/config.py
import itertools
import yaml
import sys
from collections import OrderedDict, namedtuple
from datetime import timedelta
from random import choice, randint, uniform
from .common_utils import parse_timedelta
from .io_utils import write_yaml_file




# List of all available hyperparameters
Config = namedtuple('Config', '''
    dataset_name
    epochs
    time_limit
    batch_size

    reduce_lr_factor
    reduce_lr_patience
    early_stopping_patience

    lemmatize_caption
    rare_words_handling
    words_min_occur

    learning_rate
    vocab_size
    embedding_size
    rnn_output_size
    dropout_rate

    bidirectional_rnn
    rnn_type
    rnn_layers

    l1_reg

    l2_reg