in src/metadata.py [0:0]
def extract_radians(md_string):
"""
Creates a radian representation of date information that uses: hour, day, week,
month information encapsulated in one 8-dimensional vector.
"""
date = split_datetime_md(md_string)
hour = date.hour # Between 0 and 23
day = date.weekday() # Between 0 and 6
week = date.isocalendar()[1] - 1 # Between 0 and 52
month = date.month - 1 # between 0 and 11
radians_hour = [math.sin(2*math.pi*hour/24), math.cos(2*math.pi*hour/24)]
radians_day = [math.sin(2*math.pi*day/7), math.cos(2*math.pi*day/7)]
radians_week = [math.sin(2*math.pi*week/53), math.cos(2*math.pi*week/53)]
radians_month = [math.sin(2*math.pi*month/12), math.cos(2*math.pi*month/12)]
all_radians = radians_hour + radians_day + radians_week + radians_month
return torch.FloatTensor(all_radians)