Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
177 additions
and
110 deletions.
There are no files selected for viewing
BIN
+618 KB
figures/walking-robot-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
+2.19 MB
figures/walking-robot.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
* not exported :noexport: | ||
|
||
#+tblname: daydate | ||
| Day | Date | | ||
|-----+-----------| | ||
| 1 | 05/6/2023 | | ||
| 2 | 06/6/2023 | | ||
| 3 | 07/6/2023 | | ||
| 4 | 09/6/2023 | | ||
|
||
#+tblname: times | ||
| Slot | Timings | | ||
|------+--------------| | ||
| 1 | 10:00--11:15 | | ||
| 2 | 11:30--13:00 | | ||
| 3 | 14:00--15:15 | | ||
| 4 | 15:30--17:00 | | ||
|
||
#+tblname: timetable | ||
| Day | Slot | Row | Title | | ||
|-----+------+-----+----------------------------| | ||
| 1 | 1 | 1 | Introduction to the course | | ||
| 1 | 2 | 2 | Intro to RL | | ||
| 1 | 3 | 3 | OpenAI Gym, Gymnasium | | ||
| 1 | 4 | 4 | Lab: Frozen-Lake play | | ||
| 2 | 1 | 5 | MDPs | | ||
| 2 | 2 | 6 | Dynamic Programming | | ||
| 2 | 3 | 7 | Lab: Solving Frozen-Lake | | ||
| 2 | 4 | 8 | Monte Carlo Methods | | ||
| 3 | 1 | 9 | Lab: Blackjack with MC | | ||
| 3 | 2 | 10 | Function Approximation | | ||
| 3 | 3 | 11 | DQN, SAC, PPO | | ||
| 3 | 4 | 12 | Lab: Breakout | | ||
| 4 | 1 | 13 | Lab: Demo day | | ||
| 4 | 2 | 14 | Demos and wrap up | | ||
#+tblfm: $3=(@#-1)::$2=(($3-1) % 4)+1::$1=($3 - 1) \ 4 + 1 | ||
#+BEGIN_SRC ipython :session ical :var times=times timetable=timetable daydate=daydate | ||
# ensure you set pyvenv-workon to ical first | ||
import pandas as pd | ||
from icalendar import Calendar, Event | ||
import datetime | ||
import re | ||
mre = re.compile(r"([0-9]*:[0-9]*)--([0-9]*:[0-9]*)") | ||
timeformat = "%H:%M" | ||
|
||
def convert_time_range(s): | ||
m = mre.match(s) | ||
assert m | ||
return (datetime.datetime.strptime(m[1], timeformat).time(), | ||
datetime.datetime.strptime(m[2], timeformat).time()) | ||
|
||
slots = (pd.DataFrame(timetable, columns=["day", "slot", "row", "title"]) | ||
.assign(day=lambda x: x.day.astype(int)) | ||
) | ||
|
||
times = (pd.DataFrame(times, columns=["slot", "times"]) | ||
.assign(slot=lambda x: x.slot.astype(int)) | ||
.assign(time_range=lambda x: x.times.apply(convert_time_range)) | ||
.drop(['times'], axis=1) | ||
.set_index("slot") | ||
) | ||
|
||
daydate = (pd.DataFrame(daydate, columns=["day", "date"]) | ||
.assign(day=lambda x: x.day.astype(int), | ||
date=lambda x: x.date.apply(lambda y: datetime.datetime.strptime(y, "%d/%m/%Y"))) | ||
.set_index("day") | ||
) | ||
|
||
|
||
|
||
slots = (slots.join(times, on='slot') | ||
.join(daydate, on="day") | ||
) | ||
|
||
cal = Calendar() | ||
cal.add('prodid', '-//My calendar product//mxm.dk//') | ||
cal.add('version', '2.0') | ||
|
||
for ix, row in slots.iterrows(): | ||
|
||
tz = datetime.timezone(datetime.timedelta(hours=5)) | ||
dstart = datetime.datetime.combine(row.date, row.time_range[0], tzinfo=tz) | ||
dend = datetime.datetime.combine(row.date, row.time_range[1], tzinfo=tz) | ||
|
||
event = Event() | ||
event.add('summary', row.title) | ||
event.add('location', "") | ||
event.add('dtstart', dstart) | ||
event.add('dtend', dend) | ||
event.add('dtstamp', datetime.datetime.now()) | ||
cal.add_component(event) | ||
|
||
|
||
with open("rl-course.ics", "wb") as f: | ||
f.write(cal.to_ical()) | ||
|
||
from os import system | ||
|
||
system("rsync rl-course.ics cogentee:public_html/rl-course.ics") | ||
|
||
#+END_SRC | ||
|
||
#+RESULTS: | ||
: # Out[12]: | ||
: : 0 |