Learning How to Tie Knots