Skip to content

ml-worthing/intro-ml-python

Repository files navigation

intro-ml-python

Playground project for learning purposes

setup

first time

conda create --name tf pip python=3.6 #create virtual environment
source activate tf  # enter created environment
pip install -r requirements.txt # inside environment install tensorflow and all dependencies

next time

source activate tf  # enter created environment
# or 
conda activate tf

occasionally

pip install --upgrade tensorflow
pip freeze > requirements.txt 
pip install -r requirements.txt
pip install -r requirements.txt --upgrade
conda update conda
pip install --upgrade pip
pip install --upgrade jupyter
pip install --upgrade notebook
pip install --upgrade tensorboard

jupyter notebook #start jupyter

conda update -n base -c defaults conda
 

tensor board

tensorboard --logdir func_approx/.tensorboard-func_approx.py

Running from commandline

  • Make sure tf environment is active
  • Use run.sh <path_to_python_script>, for example
./run.sh func_approx/func_approx.py
  • or add this to the root of the python script:
import os,sys,inspect
currdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.append(os.path.dirname(currdir))

modules and auto reloading

tl/df

%load_ext autoreload
%autoreload 2
# %aimport

https://ipython.readthedocs.io/en/stable/config/extensions/autoreload.html

Setup IDE

Find the environment path:

conda info --envs | grep tf

Intellij Ultimate Edition

Open project settings and add python SDK pointing to proper virtual environment found above: Setup Intellij

And mark folder as sources.

PyCharm Community Edition

Setup Pycharm

Activation functions

About

Playground project for learning purposes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published