All Projects → wandb → Examples

wandb / Examples

Example deep learning projects that use wandb's features.

Projects that are alternatives of or similar to Examples

Top250movie douban
TOP250豆瓣电影短评:Scrapy 爬虫+数据清理/分析+构建中文文本情感分析模型
Stars: ✭ 387 (-1.02%)
Mutual labels:  jupyter-notebook
Graph transformer networks
Graph Transformer Networks (Authors' PyTorch implementation for the NeurIPS 19 paper)
Stars: ✭ 387 (-1.02%)
Mutual labels:  jupyter-notebook
Tensorflow Docs
TensorFlow 最新官方文档中文版
Stars: ✭ 3,782 (+867.26%)
Mutual labels:  jupyter-notebook
Toyplot
Interactive plotting for Python.
Stars: ✭ 389 (-0.51%)
Mutual labels:  jupyter-notebook
Learning Deep Learning
Paper reading notes on Deep Learning and Machine Learning
Stars: ✭ 388 (-0.77%)
Mutual labels:  jupyter-notebook
Keras Facenet
Facenet implementation by Keras2
Stars: ✭ 390 (-0.26%)
Mutual labels:  jupyter-notebook
Computer Vision Basics With Python Keras And Opencv
Full tutorial of computer vision and machine learning basics with OpenCV and Keras in Python.
Stars: ✭ 387 (-1.02%)
Mutual labels:  jupyter-notebook
Zhihu Text Classification
[2017知乎看山杯 多标签 文本分类] ye组(第六名) 解题方案
Stars: ✭ 392 (+0.26%)
Mutual labels:  jupyter-notebook
Mlcourse
Machine learning course materials.
Stars: ✭ 388 (-0.77%)
Mutual labels:  jupyter-notebook
Workshopscipy
A workshop for scientific computing in Python. ( December 2017 )
Stars: ✭ 391 (+0%)
Mutual labels:  jupyter-notebook
Bayesian changepoint detection
Methods to get the probability of a changepoint in a time series.
Stars: ✭ 387 (-1.02%)
Mutual labels:  jupyter-notebook
Production Data Science
Production Data Science: a workflow for collaborative data science aimed at production
Stars: ✭ 388 (-0.77%)
Mutual labels:  jupyter-notebook
Private Ai
Repo for Udacity's Secure & Private AI course
Stars: ✭ 391 (+0%)
Mutual labels:  jupyter-notebook
Summerschool2015
Slides and exercises for the Deep Learning Summer School 2015 programming tutorials
Stars: ✭ 388 (-0.77%)
Mutual labels:  jupyter-notebook
Pattern classification
A collection of tutorials and examples for solving and understanding machine learning and pattern classification tasks
Stars: ✭ 3,880 (+892.33%)
Mutual labels:  jupyter-notebook
Data Science And Machine Learning From Scratch
Implements common data science methods and machine learning algorithms from scratch in python. Intuition and theory behind the algorithms is also discussed.
Stars: ✭ 387 (-1.02%)
Mutual labels:  jupyter-notebook
Comma2k19
A driving dataset for the development and validation of fused pose estimators and mapping algorithms
Stars: ✭ 391 (+0%)
Mutual labels:  jupyter-notebook
Deepnetsforeo
Deep networks for Earth Observation
Stars: ✭ 393 (+0.51%)
Mutual labels:  jupyter-notebook
Nmtpytorch
Sequence-to-Sequence Framework in PyTorch
Stars: ✭ 392 (+0.26%)
Mutual labels:  jupyter-notebook
Open source demos
A collection of demos showcasing automated feature engineering and machine learning in diverse use cases
Stars: ✭ 391 (+0%)
Mutual labels:  jupyter-notebook
Weights & Biases
Weights & Biases

🚀 Getting Started

Never lose your progress again.

Save everything you need to compare and reproduce models — architecture, hyperparameters, weights, model predictions, GPU usage, git commits, and even datasets — in 5 minutes. W&B is free for personal use and academic projects, and it's easy to get started.

→ Check out our library of example scripts → or read on for code snippets and more!

If you have any questions, please don't hesitate to ask in our Slack community.

🤝 Simple integration with any framework

Install wandb library and login:

pip install wandb
wandb login

Flexible integration for any Python script:

import wandb

# 1. Start a W&B run
wandb.init(project='gpt3')

# 2. Save model inputs and hyperparameters
config = wandb.config
config.learning_rate = 0.01

# Model training code here ...

# 3. Log metrics over time to visualize performance
for i in range (10):
    wandb.log({"loss": loss})

Try in a colab →

If you have any questions, please don't hesitate to ask in our Slack community.

Explore a W&B dashboard

📈 Track model and data pipeline hyperparameters

Set wandb.config once at the beginning of your script to save your hyperparameters, input settings (like dataset name or model type), and any other independent variables for your experiments. This is useful for analyzing your experiments and reproducing your work in the future. Setting configs also allows you to visualize the relationships between features of your model architecture or data pipeline and the model performance (as seen in the screenshot above).

wandb.init()
wandb.config.epochs = 4
wandb.config.batch_size = 32
wandb.config.learning_rate = 0.001
wandb.config.architecture = "resnet"

🏗 Use your favorite framework

🥕 Keras

In Keras, you can use our callback to automatically save all the metrics tracked in model.fit. To get you started here's a minimal example:

# Import W&B
import wandb
from wandb.keras import WandbCallback

# Step1: Initialize W&B run
wandb.init(project='project_name')

# 2. Save model inputs and hyperparameters
config = wandb.config
config.learning_rate = 0.01

# Model training code here ...

# Step 3: Add WandbCallback 
model.fit(x_train, y_train,  validation_data=(x_test, y_test),
          callbacks=[WandbCallback()])

🔥 PyTorch

W&B provides first class support for PyTorch. To automatically log gradients and store the network topology, you can call .watch and pass in your PyTorch model. Then use .log for anything else you want to track, like so:

import wandb

# 1. Start a new run
wandb.init(project="gpt-3")

# 2. Save model inputs and hyperparameters
config = wandb.config
config.dropout = 0.01

# 3. Log gradients and model parameters
wandb.watch(model)
for batch_idx, (data, target) in enumerate(train_loader):
  ...  
  if batch_idx % args.log_interval == 0:      
    # 4. Log metrics to visualize performance
    wandb.log({"loss": loss})

⚡ PyTorch Lightning

W&B is integrated directly into PyTorch Lightning through their loggers API.

import wandb
from pytorch_lightning.loggers import WandbLogger
from pytorch_lightning import Trainer

# add logging into your training_step (and elsewhere!)
def training_step(self, batch, batch_idx):
    ...
    self.log('train/loss', loss)
    return loss

# add a WandbLogger to your Trainer
wandb_logger = WandbLogger()
trainer = Trainer(logger=wandb_logger)

# .fit your model
trainer.fit(model, mnist)

🌊 TensorFlow

The simplest way to log metrics in TensorFlow is by logging tf.summary with our TensorFlow logger:

import wandb

# 1. Start a W&B run
wandb.init(project='gpt3')

# 2. Save model inputs and hyperparameters
config = wandb.config
config.learning_rate = 0.01

# Model training here

# 3. Log metrics over time to visualize performance
with tf.Session() as sess:
  # ...
  wandb.tensorflow.log(tf.summary.merge_all())

💨 fastai

Visualize, compare, and iterate on fastai models using Weights & Biases with the WandbCallback.

import wandb
from fastai.callback.wandb import WandbCallback

# 1. Start a new run
wandb.init(project="gpt-3")

# 2. Automatically log model metrics
learn.fit(..., cbs=WandbCallback())

🤗 HuggingFace

Just run a script using HuggingFace's Trainer in an environment where wandb is installed and we'll automatically log losses, evaluation metrics, model topology and gradients:

# 1. Install the wandb library
pip install wandb

# 2. Run a script that has the Trainer to automatically logs metrics, model topology and gradients
python run_glue.py \
 --model_name_or_path bert-base-uncased \
 --task_name MRPC \
 --data_dir $GLUE_DIR/$TASK_NAME \
 --do_train \
 --evaluate_during_training \
 --max_seq_length 128 \
 --per_gpu_train_batch_size 32 \
 --learning_rate 2e-5 \
 --num_train_epochs 3 \
 --output_dir /tmp/$TASK_NAME/ \
 --overwrite_output_dir \
 --logging_steps 50

🧹 Optimize hyperparameters with Sweeps

Use Weights & Biases Sweeps to automate hyperparameter optimization and explore the space of possible models.

Try Sweeps in PyTorch in a Colab →

Try Sweeps in TensorFlow in a Colab →

Benefits of using W&B Sweeps

  • Quick to setup: With just a few lines of code you can run W&B sweeps.
  • Transparent: We cite all the algorithms we're using, and our code is open source.
  • Powerful: Our sweeps are completely customizable and configurable. You can launch a sweep across dozens of machines, and it's just as easy as starting a sweep on your laptop.

Get started in 5 mins →

Weights & Biases

Common use cases

  • Explore: Efficiently sample the space of hyperparameter combinations to discover promising regions and build an intuition about your model.
  • Optimize: Use sweeps to find a set of hyperparameters with optimal performance.
  • K-fold cross validation: Here's a brief code example of k-fold cross validation with W&B Sweeps.

Visualize Sweeps results

The hyperparameter importance plot surfaces which hyperparameters were the best predictors of, and highly correlated to desirable values for your metrics.

Weights & Biases

Parallel coordinates plots map hyperparameter values to model metrics. They're useful for honing in on combinations of hyperparameters that led to the best model performance.

Weights & Biases

📜 Share insights with with Reports

Reports let you organize visualizations, describe your findings, and share updates with collaborators.

Common use cases

  • Notes: Add a graph with a quick note to yourself.
  • Collaboration: Share findings with your colleagues.
  • Work log: Track what you've tried and plan next steps.

Explore reports in The Gallery → | Read the Docs

Once you have experiments in W&B, you can visualize and document results in Reports with just a few clicks. Here's a quick demo video.

🏺 Version control datasets and models with Artifacts

Git and GitHub make code version control easy, but they're not optimized for tracking the other parts of the ML pipeline: datasets, models, and other large binary files.

W&B's Artifacts are. With just a few extra lines of code, you can start tracking you and your team's outputs, all directly linked to run.

Try Artifacts in a Colab with a video tutorial

Common use cases

  • Pipeline Management: Track and visualize the inputs and outputs of your runs as a graph
  • Don't Repeat Yourself™: Prevent the duplication of compute effort
  • Sharing Data in Teams: Collaborate on models and datasets without all the headaches

Learn about Artifacts here → | Read the Docs

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].