Giter Site home page Giter Site logo

cse-stat-416-book's Introduction

CSE/STAT 416 Book

Repository to manage book for CSE/STAT 416

Draft of book text is here.

Installation

This project currently uses manim (3Blue1Brown's animation library) and some JupyterLab notebooks. Requires Python 3.7. The requirements.txt has all Python packages in my virtual environment.

Set up a virtual environment using your favorite tool (e.g., Anaconda).

conda create --name 416-book python=3.7
conda activate 416-book
pip install -r requirements.txt

You will potentially need some other system requirements based for the manim library.

See SetupErrors.md for some issues others have run into while setting this up.

This project uses pre-commit to handle its git hooks. It is already install from the earlier command, but you will need to have it set up by running

pre-commit install

Development

We use a Python formatter named black to auto-format Python code. You will not be able to commit Python files if they don't pass black's linter.

We use manim to generate the animations for the book. See the next two sections for how to run that.

Generating a Video (Directly with Manim)

Once you've installed manim and are in your environment, you can run the manim command in any of the directories that have manim scripts. For example

manim models.py Models -pls

There a few useful manim flags (you can see manim --help for more info).

  • -p Immediately previews the result
  • -l Renders the animation in low quality. This is great for development to save time.
  • -s Outputs the final frame instead of the whole animation. Good for development when not working on the actual animations.

Generate Videos (using ./genvids.py)

After you've installed manim, you can use the ./genvids.py script to compile all videos in the animations/ directory. The script by default renders all the videos in the highest quality.

In the root directory there is a file called manim_config.py, which includes some helper classes for generating animations. The convention right now is to subclass the element you want to change and prepend it with a "B" (for "Book"), for example "Scene" -> "BScene", "TextMobject" -> "BTextMobject", etc. There are also some default colors for consistency across animations.

In order for files to be tracked by the build script, the following needs to be true:

  • One scene per file named class Animation(Scene).
  • Any files have to end in _anim.py (ex: lr_anim.py, ml_anim.py).

A good start for an animation file is:

from manim_config import *

class Animation(BScene):
    def construct(self):
        pass

Arguments

You can target specfic files by calling ./getvids.py path/to/file1_anim.py path/to/file2_anim.py [...].

Parameters

Use ./genvids.py --help for all flags:

  • -p immediately previews the result
  • -l renders the animation in low quality. This is great for development to save time.
  • -s outputs the final frame instead of the whole animation. Good for development when not working on the actual animations.
  • --hard ignores the cached files and recompiles all animations in the animations/ folder

Website

See the README.md in the website folder for more information.

cse-stat-416-book's People

Contributors

dependabot[bot] avatar rockettm avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

cse-stat-416-book's Issues

Update examples in datasets

Examples like housing prices are kind of meh, are there datasets that we can use to show off course themes that are a little more exciting/relevant?

Assessing Performance Animations

Here is the updated list from the one I sent you. Let me know which of these you can do or if you need help with any of the things I was imagining for these. Any you don't get to, I can pick up ๐Ÿ˜„

  • New: Animation showing conditional distributions
  • Training error curve
  • True error curve
  • Combined animation of train/true/test
  • Overfitting animation. Change w's to p's
  • Average predictor
  • Bias
  • Variance
  • Bias-variance tradeoff
  • Animating 2 points vs 100 points (doesn't actually have to be 100)

Split from #9

Format for Recap/Terms

Identify a good format for the end of a chapter to highlight important terms/concepts, tie big ideas together, and leave questions for the reader.

Add references

Mostly to cite Emily and Carlos, but other citations as I gather them.

Bootstrap (CSS revamp)

It would be pretty nice if we could use some bootstrap styles but it is a pain to try to include them and get them to work well with the Tufte styles. Might require a rewrite of the CSS files we use, but would be kind of nice for including some more modern components.

Update ML Pipeline

  • Update picture to include an evaluate step after \hat{y}
  • Maybe update design (Aaron?)
  • Integrate it into chapters
    • Linear regression (5 TODOs)

Ridge Animations

List of animations in the webpage as is:

  • Investigate if it looks bad to try to make a 3D animation of a multiple regression model.
  • Make a picture of a high degree polynomial through data (maybe steal from Chapter 2)
  • Show how the magnitude of coefficients grow with overfitting. Might be hard to fit into one animation, but I could imagine doing a side-by-side animation where the left-pane shows a polynomial fit (animating through different degrees) and the right-pane shows a graph of the magnitude of the coefficients as you increase the degree.

Figure out Table of Contents and Case Studies

  • What is the easiest way to config the case studies having multiple chapters? What do we do about intro or other chapters that don't fit in a case study?
  • How do we handle navigation in chapters? This is both a question of the UI to move between chapters and within the sections of a chapter.

Introduction

Things to talk about

  • Our values (ML is critical for everyone to understand*, Everyone can learn ML [focus on ideas, use math for convenience but not rigor]),
    • Asterisk on how "understand" can mean different things to different people
    • What this book is not.
  • How learning works
  • Forward acknowledgements #25?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.