Worked examples following Deep Learning with Python by François Chollet It's an amazing book - likely the fastest way to get started with machine learning!
Source code from the book available on GitHub
This repository is WIP. Feel free to reach out with questions via Issues
Coding is likely less scary than you think. Going from 0 knowledge to running the code above will take you less than 10 minutes, just follow the steps below!
Install requirements:
- Install git
- this will allow you to copy all the code in this repository
- Install Python 3.6+
- this will automatically install pip (Pip Installs Python - a way to download packages)
- Install virtualenv
- open your terminal and run the command
pip install virtualenv
- open your terminal and run the command
You'll now be using your terminal. On Mac or Linux you're ready to go. On Windows you'll want to use git-bash (that was installed when you installed git). If you're more comfortable with setting things up, consider these alternative terminals: Hyper, FluentTerminal or Terminus. On Mac or Linux, consider installing oh my zsh (requires you install 'zsh' first).
Open your terminal and enter these commands:
cd ~
- this will navigate to your "home" directory
- please navigate using
cd
to a folder where you'd like to work- perhaps create a folder called "code"
- you can do that from the terminal with:
mkdir code
git clone https://github.com/whyboris/ml-with-python-and-keras.git
- this will create a folder
ml-with-python-and-keras
inside the folder you are in copying this whole repository
- this will create a folder
cd ml-with-python-and-keras
- this will enter the folder
virtualenv venv
- this will create a folder named "venv" inside your dir
- having a virtual environment allows packages you instal to not interfere with other packages in other projects
source venv/bin/activate
- this will activate the environment, allowing you to
pip install -r requirements.txt
- This installs all the packages listed in
requirements.txt
- This installs all the packages listed in
You're ready to run any of the scripts above!
I recommend you also install Visual Studio Code to work with code.
Open any of the above scripts to see what it does. Run them in your terminal, for example python3 news.py
👍
As you spend more time in the terminal, many actions become too repetitive, so you can create shortcuts of commands (called alias) to save yourself time (and the hassle of remembering some of the longer ones). These need to be saved in a specific file on your computer, .bashrc
, .zshrc
, or somewhere else (depends on the terminal and settings you use). I recommend these:
alias py="python3"
- allows you to run scripts with
py script.py
rather thanpython3 script.py
- allows you to run scripts with
alias activate="source venv/bin/activate"
- allows you to activate the environment with the command
activate
(see step 4 above).
- allows you to activate the environment with the command