Difference between revisions of "Getting Started with Machine Learning"

From Humanoid Robots Wiki
Jump to: navigation, search
(Created page with "This is User:Ben's guide to getting started with machine learning. === Dependencies === Here's some useful dependencies that I use: * [https://astral.sh/blog/uv uv] **...")
 
Line 12: Line 12:
 
* [https://github.com/kscalelabs/mlfab mlfab]
 
* [https://github.com/kscalelabs/mlfab mlfab]
 
** This is a Python package I made to help make it easy to quickly try out machine learning ideas in PyTorch
 
** This is a Python package I made to help make it easy to quickly try out machine learning ideas in PyTorch
 +
* Coding tools
 +
** [https://mypy-lang.org/ mypy] static analysis
 +
** [https://github.com/psf/black black] code formatter
 +
** [https://docs.astral.sh/ruff/ ruff] alternative to flake8
  
 
=== Installing Starter Project ===
 
=== Installing Starter Project ===
Line 53: Line 57:
 
* SSH into the cluster (see [[K-Scale Cluster]] for instructions)
 
* SSH into the cluster (see [[K-Scale Cluster]] for instructions)
 
* Open the workspace that you created in VSCode
 
* Open the workspace that you created in VSCode
 +
 +
=== Useful Brain Dump Stuff ===
 +
 +
* Use <code>breakpoint()</code> to debug code

Revision as of 01:41, 20 May 2024

This is User:Ben's guide to getting started with machine learning.

Dependencies

Here's some useful dependencies that I use:

  • uv
    • This is similar to Pip but written in Rust and is way faster
    • It has nice management of virtual environments
    • Can use Conda instead but it is much slower
  • Github Copilot
  • mlfab
    • This is a Python package I made to help make it easy to quickly try out machine learning ideas in PyTorch
  • Coding tools
    • mypy static analysis
    • black code formatter
    • ruff alternative to flake8

Installing Starter Project

Opening the project in VSCode

  • Create a VSCode config file that looks something like this:
{
  "folders": [
    {
      "name": "Getting Started",
      "path": "/home/ubuntu/Github/getting_started"
    },
    {
      "name": "Workspaces",
      "path": "/home/ubuntu/.code-workspaces"
    }
  ],
  "settings": {
    "cmake.configureSettings": {
      "CMAKE_CUDA_COMPILER": "/usr/bin/nvcc",
      "CMAKE_PREFIX_PATH": [
        "/home/ubuntu/.virtualenvs/getting-started/lib/python3.11/site-packages/torch/share/cmake"
      ],
      "PYTHON_EXECUTABLE": "/home/ubuntu/.virtualenvs/getting-started/bin/python",
      "TORCH_CUDA_ARCH_LIST": "'8.0'"
    },
    "python.defaultInterpreterPath": "/home/ubuntu/.virtualenvs/getting-started/bin/python",
    "ruff.path": [
      "/home/ubuntu/.virtualenvs/getting-started/bin/ruff"
    ]
  }
}

Useful Brain Dump Stuff

  • Use breakpoint() to debug code