-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Maintainer Info
Clang Tidy can be run by:
mkdir build
cd build
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=On
cd ..
clang-tidy -p build --checks=* <file_here>
Note: --checks=*
produces way too many irrelevant warnings, see below for a recommended list.
This command line works pretty well:
clang-tidy -p build --checks=-*,readability-*,modernize-*,performance-*,-modernize-use-trailing-return-type,-readability-uppercase-literal-suffix <file_here>
The pretty printing script allows GDB to visualize types that it cannot by default, such as v_array
. This works both with command line and using GDB in VSCode. The same thing is done in Visual Studio on Windows using the natvis file, which is included in the project and automatically loaded.
In order to use the GDB pretty printers, they need to be loaded. This can either be done automatically when GDB is started or each time.
To load the script into a running gdb session you can run:
(gdb) python exec(open('path/to/vowpalwabbit/gdb_pretty_printers.py').read())
To automatically load it, create the file if it does not exist ~/.gdbinit
, and add the script load into that file:
python exec(open('path/to/vowpalwabbit/gdb_pretty_printers.py').read())
If using VSCode, ensure the launch target contains the following properties:
MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
pip3 install yapf mypy pylint --user
-
yapf
- Code formatter- Usage:
python3 -m yapf -i python/vowpalwabbit/*.py
- By default uses PEP8 style
- Any other formatter can be used
- Usage:
-
mypy
- Static type checking- Usage:
python3 -m mypy vowpalwabbit/*.py --ignore-missing-imports
-
--ignore-missing-imports
is required as the native extension, `pylibvw, does not have type stubs.
-
-
mypy
supports mixed dynamic and static typed Python, so the code can be annotated one function at a time
- Usage:
-
pylint
- Python code linting- Usage:
python3 -m pylint vowpalwabbit/*.py
- Usage:
Instructions from: https://apt.kitware.com/
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
# 16.04
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
# 18.04
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt-get update
# Optional, ensure keyring stays up to date as it is rotated.
sudo apt-get install kitware-archive-keyring
sudo apt-key --keyring /etc/apt/trusted.gpg del C1F34CDD40CD72DA
sudo apt-get install cmake
Download and install from: https://cmake.org/download/
- Home
- First Steps
- Input
- Command line arguments
- Model saving and loading
- Controlling VW's output
- Audit
- Algorithm details
- Awesome Vowpal Wabbit
- Learning algorithm
- Learning to Search subsystem
- Loss functions
- What is a learner?
- Docker image
- Model merging
- Evaluation of exploration algorithms
- Reductions
- Contextual Bandit algorithms
- Contextual Bandit Exploration with SquareCB
- Contextual Bandit Zeroth Order Optimization
- Conditional Contextual Bandit
- Slates
- CATS, CATS-pdf for Continuous Actions
- Automl
- Epsilon Decay
- Warm starting contextual bandits
- Efficient Second Order Online Learning
- Latent Dirichlet Allocation
- VW Reductions Workflows
- Interaction Grounded Learning
- CB with Large Action Spaces
- CB with Graph Feedback
- FreeGrad
- Marginal
- Active Learning
- Eigen Memory Trees (EMT)
- Element-wise interaction
- Bindings
-
Examples
- Logged Contextual Bandit example
- One Against All (oaa) multi class example
- Weighted All Pairs (wap) multi class example
- Cost Sensitive One Against All (csoaa) multi class example
- Multiclass classification
- Error Correcting Tournament (ect) multi class example
- Malicious URL example
- Daemon example
- Matrix factorization example
- Rcv1 example
- Truncated gradient descent example
- Scripts
- Implement your own joint prediction model
- Predicting probabilities
- murmur2 vs murmur3
- Weight vector
- Matching Label and Prediction Types Between Reductions
- Zhen's Presentation Slides on enhancements to vw
- EZExample Archive
- Design Documents
- Contribute: