- python codes should be indented by 4 spaces.
- python doc strings are denoted by three double quotes.
- a module is just a file. it allows code to be reusable by encapsulating them into a file which makes it easier to import into other files.
- production code is software running on production servers to handle live users and data of the intended audience.
- a code is modular if it is logically broken up into functions and modules.
- limit python code lines by 79 characters ( as specified by pep guidelines )
- types of documentation -line level (inline comments) -function or module level -project level
- test driven development is writing tests before writing code that is being tested.
- tests can check for every edge cases and scenarios. Implementing a function in test driven development gives immediate feedback about the code being tested.
- when refactoring, tests help confirm that the rest of our code didn't break during the process.
- benefits of code reviews
- catch errors
- ensure readability
- check standards are met.
- share knowledge among a team.
- advantages of unit tests
- they are isolated from other parts of your code thus doesn't require access to the database or api.
install and manage python installion environments with conda:
- conda create --name environmentname
- source activate environmentname
- conda install numpy Conda manages environments AND packages. Pip only manages packages.
commands used to upload projects to pypi
cd binomial_package_files python setup.py sdist pip install twine
twine upload --repository-url https://test.pypi.org/legacy/ dist/* pip install --index-url https://test.pypi.org/simple/ dsnd-probability
twine upload dist/* pip install dsnd-probability
generative ai lets the computer learn the underlying pattern associated with the provided input and lets the model to create new content. Examples of generative ai techniques includes transformers, auto encoders and generative adversary networks.
GANs, a generative AI technique, pit 2 networks against each other to generate new content. The algorithm consists of two competing networks: a generator and a discriminator.
A generator is a convolutional neural network (CNN) that learns to create new data resembling the source data it was trained on.
The discriminator is another convolutional neural network (CNN) that is trained to differentiate between real and synthetic data.
When the training loop has passed through the entire training dataset once, we call that one epoch.