Reinforcement learning from scratch