---
# System prepended metadata

title: Kirsten's notes on the go

---

# Kirsten's notes on the go

As I'm working through adding Inception Score to the repo, as an initial toy example of contributing, I'm going to pop any links, any commands, or any notes in here, just in case it saves anyone time. Most of the things you will probably already know or would be quick to look up, but no harm in documenting.

**Creating a feature branch**
Feature branches should branch from dev branch. I just did it on GitHub GUI by changing to dev branch with the drop down list and then in the same drop down menu typing out the new name of my feature branch and selecting the create branch option. Alternatively, can do from terminal.

**Creating a virtual environment with virtualenv**
After cloning the repo to my local machine, I opened the project directory, opened a terminal at the root, and used the command `virtualenv venv`. This creates a virtual environment named venv, producing a directory of the same name within the project directory. To activate (on linux) I used the command `source venv/bin/activate`. Once active, you should see the environment name before the terminal prompt. I then started installing dependencies with `pip install`.

**Updating requirements file**
Used `pip freeze > requirements.txt` in the terminal to auto populate

**Creating docstrings for modules and functions**
We've agreed on the google docstring format. I used the following links to inform formatting - https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html provides an example of a module docstring (i.e. at top), https://betterprogramming.pub/3-different-docstring-formats-for-python-d27be81e0d68 provides an example of a function docstring. 

**Docstring linting**
My vscode is already using Pylance to do linting, but it doesn't seem to include docstrings so I installed the package pydocstyle and then used `pydocstyle inception_score.py` from the terminal (see http://www.pydocstyle.org/en/stable/). Note: can set style to google. This printed a list of errors to the terminal but it doesn't look at max line length which was what I was wanting in this instance. Not sure whether this package will come in useful or not. Added line breaks manually for now at approx 80 characters.

**Docstring content standard**
Will need to develop these as we go. Have had a first go with the module and function docstrings in inception_score.py but feel free to suggest changes, e.g. that metric description is too long. Definitely need to cite/acknowledge sources of code.

**Refactoring code**
Although I haven't implemented anything new with the inception score, by comaring with the original at https://machinelearningmastery.com/how-to-implement-the-inception-score-from-scratch-for-evaluating-generated-images/ you might be able to see how the code has been slightly refactored, i.e. the `scale_images()` function has been shoved in utils.py. and the section of code at the end which loads in cifar-10 has been moved to datasets.py, so that the only code contained in inception_score.py is the calculation of the metric itself

