Giter VIP home page Giter VIP logo

pytorchstepbystep's Introduction

Deep Learning with PyTorch Step-by-Step

This is the official repository of my book "Deep Learning with PyTorch Step-by-Step". Here you will find one Jupyter notebook for every chapter in the book.

Each notebook contains all the code shown in its corresponding chapter, and you should be able to run its cells in sequence to get the same outputs as shown in the book. I strongly believe that being able to reproduce the results brings confidence to the reader.

There are three options for you to run the Jupyter notebooks:

Google Colab

You can easily load the notebooks directly from GitHub using Colab and run them using a GPU provided by Google. You need to be logged in a Google Account of your own.

You can go through the chapters already using the links below:

Part I - Fundamentals

Part II - Computer Vision

Part III - Sequences

Part IV - Natural Language Processing

Binder

You can also load the notebooks directly from GitHub using Binder, but the process is slightly different. It will create an environment on the cloud and allow you to access Jupyter's Home Page in your browser, listing all available notebooks, just like in your own computer.

If you make changes to the notebooks, make sure to download them, since Binder does not keep the changes once you close it.

You can start your environment on the cloud right now using the button below:

Binder

Local Installation

This option will give you more flexibility, but it will require more effort to set up. I encourage you to try setting up your own environment. It may seem daunting at first, but you can surely accomplish it following seven easy steps:

1 - Anaconda

If you don’t have Anaconda’s Individual Edition installed yet, that would be a good time to do it - it is a very handy way to start - since it contains most of the Python libraries a data scientist will ever need to develop and train models.

Please follow the installation instructions for your OS:

Make sure you choose Python 3.X version since Python 2 was discontinued in January 2020.

2 - Conda (Virtual) Environments

Virtual environments are a convenient way to isolate Python installations associated with different projects.

First, you need to choose a name for your environment :-) Let’s call ours pytorchbook (or anything else you find easier to remember). Then, you need to open a terminal (in Ubuntu) or Anaconda Prompt (in Windows or macOS) and type the following command:

conda create -n pytorchbook anaconda

The command above creates a conda environment named pytorchbook and includes all anaconda packages in it (time to get a coffee, it will take a while...). If you want to learn more about creating and using conda environments, please check Anaconda’s Managing Environments user guide.

Did it finish creating the environment? Good! It is time to activate it, meaning, making that Python installation the one to be used now. In the same terminal (or Anaconda Prompt), just type:

conda activate pytorchbook

Your prompt should look like this (if you’re using Linux)...

(pytorchbook)$

or like this (if you’re using Windows):

(pytorchbook)C:\>

Done! You are using a brand new conda environment now. You’ll need to activate it every time you open a new terminal or, if you’re a Windows or macOS user, you can open the corresponding Anaconda Prompt (it will show up as Anaconda Prompt (pytorchbook), in our case), which will have it activated from start.

IMPORTANT: From now on, I am assuming you’ll activate the pytorchbook environment every time you open a terminal / Anaconda Prompt. Further installation steps must be executed inside the environment.

3 - PyTorch

It is time to install the star of the show :-) We can go straight to the Start Locally section of its website and it will automatically select the options that best suit your local environment and it will show you the command to run.

Your choices should look like:

  • PyTorch Build: "Stable"
  • Your OS: your operating system
  • Package: "Conda"
  • Language: "Python"
  • CUDA: "None" if you don't have a GPU, or the latest version (e.g. "10.1"), if you have a GPU.

The installation command will be shown right below your choices, so you can copy it. If you have a Windows computer and no GPU, you'd have to run the following command in your Anaconda Prompt (pytorchbook):

(pytorchbook) C:\> conda install pytorch torchvision cpuonly -c pytorch

4 - TensorBoard

TensorBoard is a powerful tool and we can use it even if we are developing models in PyTorch. Luckily, you don’t need to install the whole TensorFlow to get it, you can easily install TensorBoard alone using conda. You just need to run this command in your terminal or Anaconda Prompt (again, after activating the environment):

(pytorchbook)C:\> conda install -c conda-forge tensorboard

5 - GraphViz and TorchViz (optional)

This step is optional, mostly because the installation of GraphViz can be challenging sometimes (especially on Windows). If, for any reason, you do not succeed in installing it correctly, or if you decide to skip this installation step, you will still be able to execute the code in this book (except for a couple of cells that generate images of a model’s structure in the Dynamic Computation Graph section of Chapter 1).

We need to install GraphViz to be able to use TorchViz, a neat package that allows us to visualize a model’s structure. Please check the installation instructions for your OS.

If you are using Windows, please use the installer at GraphViz's Windows Package. You also need to add GraphViz to the PATH (environment variable) in Windows. Most likely, you can find GraphViz executable file at C:\ProgramFiles(x86)\Graphviz2.38\bin. Once you found it, you need to set or change the PATH accordingly, adding GraphViz's location to it. For more details on how to do that, please refer to How to Add to Windows PATH Environment Variable.

For additional information, you can also check the How to Install Graphviz Software guide.

If you installed GraphViz successfully, you can install the torchviz package. This package is not part of Anaconda Distribution Repository and is only available at PyPI , the Python Package Index, so we need to pip install it.

Once again, open a terminal or Anaconda Prompt and run this command (just once more: after activating the environment):

(pytorchbook)C:\> pip install torchviz

6 - Git

It is way beyond the scope of this guide to introduce you to version control and its most popular tool: git. If you are familiar with it already, great, you can skip this section altogether!

Otherwise, I’d recommend you to learn more about it, it will definitely be useful for you later down the line. In the meantime, I will show you the bare minimum, so you can use git to clone this repository containing all code used in this book - so you have your own, local copy of it and can modify and experiment with it as you please.

First, you need to install it. So, head to its downloads page and follow instructions for your OS. Once installation is complete, please open a new terminal or Anaconda Prompt (it's OK to close the previous one). In the new terminal or Anaconda Prompt, you should be able to run git commands. To clone this repository, you only need to run:

(pytorchbook)C:\> git clone https://github.com/dvgodoy/PyTorchStepByStep.git

The command above will create a PyTorchStepByStep folder which contains a local copy of everything available on this GitHub’s repository.

7 - Jupyter

After cloning the repository, navigate to the PyTorchStepByStep and, once inside it, you only need to start Jupyter on your terminal or Anaconda Prompt:

(pytorchbook)C:\> jupyter notebook

This will open your browser up and you will see Jupyter's Home Page containing this repository's notebooks and code.

Congratulations! You are ready to go through the chapters' notebooks!

pytorchstepbystep's People

Contributors

dvgodoy avatar nesaboz avatar scmanjarrez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytorchstepbystep's Issues

A code mistake in the book

There is a mistake on page 113 of the book.

# on page 113
predictions = torch.tensor(0.5, 1.0)
labels = torch.tensor(2.0, 1.3)

Probably what you really want to write is

predictions = torch.tensor([0.5, 1.0])
labels = torch.tensor([2.0, 1.3])

Thank you
Neuer

Bonus Chapter Feature Space.Why you say activation function increase dimensionality?

activation functions are applied element-wise to individual neurons in a neural network, and their purpose is to introduce non-linearity into the network's computations. The non-linear nature of activation functions allows neural networks to learn and approximate complex functions.so the activation functions themselves do not directly increase dimensionality.I'm get confused about your point about this.can your explian more detail about this to me. thank you.
image

Chapter 1 - A Simple Regression Problem

There is only one thing left to do; turn our tensor into a GPU tensor. That is what [to()](https://bit.ly/32Mgxjc) is good for. It sends a tensor to the specified device.

Hi Dan,

I love your book and tutorials! May I kindly ask does to() method copy the data input the device (GPU or CPU) memory directly?

The reason I am asking is that you mentioned before that torch.as_tensor(x_train) will shares the underlying data with the original Numpy array, but when we used torch.as_tensor(x_train).to(device) I found that x_train data won't change.

Do I understand it correctly?

Best,
Jun

P134 example failing with v4.py StepByStep.train()

Imported stepByStep v4.py

sbs_rnn=StepByStep(model, loss, optimizer)
sbs_rnn.set_loaders(train_loader, test_loader)
sbs_rnn.train(100) <----

this caused following fail:
/home/nonroot/sbs//ch8/ch8-p134-full-classificiation-model.py:25: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at ../torch/csrc/utils/tensor_new.cpp:276.)
train_data = TensorDataset(torch.as_tensor(points).float(),torch.as_tensor(directions).view(-1,1).float())
Traceback (most recent call last):
File "/home/nonroot/sbs//ch8/ch8-p134-full-classificiation-model.py", line 38, in
sbs_rnn.train(100)
File "/home/nonroot/sbs//ch8/../stepbystep/v4.py", line 186, in train
loss = self._mini_batch(validation=False)
File "/home/nonroot/sbs//ch8/../stepbystep/v4.py", line 155, in _mini_batch
mini_batch_loss = step_fn(x_batch, y_batch)
File "/home/nonroot/sbs//ch8/../stepbystep/v4.py", line 99, in perform_train_step_fn
yhat = self.model(x)
File "/home/guyen/.local/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/guyen/.local/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
TypeError: forward() takes 1 positional argument but 2 were given

Chapter6 - Rock, Paper, Scissors - problem with dataset

Hi, if you have the same problem as me - the original link for downloading the Rock-Paper-Scissors dataset does not work in the function download_rps()
PyTorchStepByStep>>data_generation>>rps.py

So change this line there:
url = 'https://storage.googleapis.com/laurencemoroney-blog.appspot.com/{}'

To:
url = 'https://staff.utia.cas.cz/novozada/ml2/{}'

I downloaded the data from Kaggle:
https://www.kaggle.com/datasets/sanikamal/rock-paper-scissors-dataset

And stored them in the same way as the original dataset.

Missing input in helpers.py for function "make_balanced_sampler" and WeightedRandomSampler?

I just downloaded the latest full zip file.

While running the jupyter notebook for Chapter05, I noticed a couple of errors, relating to

` in
22
23 # Builds a weighted random sampler to handle imbalanced classes
---> 24 sampler = make_balanced_sampler(y_train_tensor)
25
26 # Uses sampler in the training set to get a balanced data loader

~/projects/pytorchstepbystep_2/PyTorchStepByStep-master/helpers.py in make_balanced_sampler(y)
79 num_samples=len(sample_weights),
80 generator=generator,
---> 81 replacement=True
82 )
83 return sampler

TypeError: init() got an unexpected keyword argument 'generator'
`

I think that the issue stems from the "WeightedRandomSampler" function, which might be missing an input.
From the pytorch documentation
CLASStorch.utils.data.WeightedRandomSampler(weights: Sequence[float], num_samples: int, replacement: bool = True, generator=None)

That would be 4 inputs. "replacement" and "generator" are satisfied but either "weights" or "num_samples" seems to be missing from the call to WeightedRandomSampler from make_balanced_sampler. My guess would be that "num_samples" is the missing input.

Is that the case?

Thank You
Tom

Chapter 09, encoder-decoder Data Preparation test_points not used for test set

In the chunk for generation of the test set (Data Generation — Test) the full_testis derived from the points data structure, which are used for training, not from the test_points.

test_points, test_directions = generate_sequences(seed=19)
full_test = torch.as_tensor(points).float()
source_test = full_test[:, :2]
target_test = full_test[:, 2:]

I do not think that is intended, so there is a simple correction possible:

full_test = torch.as_tensor(test_points).float()

Based on that change we get different performance figures.
Loss:
plot_loss

and another figures prediction:

seq_pred

with 8 of 10 sequences with "clashing" points.
If my results are right, this text chunk needs some adaption as well:

The results are, at the same time, very good and very bad. In half of the sequences,
the predicted coordinates are quite close to the actual ones. But, in the other half,
the predicted coordinates are overlapping with each other and close to the
midpoint between the actual coordinates.

For whatever reason, the model learned
to make good predictions whenever the first corner is on the right edge of the
square, but really bad ones otherwise.

See sequence pictures, these statements needs to be adapted. Especially the second.

Same issue can be found in the final putting it all together section:

# Validation/Test Set
test_points, test_directions = generate_sequences(seed=19)
full_test = torch.as_tensor(points).float()
source_test = full_test[:, :2]
target_test = full_test[:, 2:]
test_data = TensorDataset(source_test, target_test)
test_loader = DataLoader(test_data, batch_size=16)

All based on your 1.1 revision, if I did not make any mistakes in updating by git pull.

[Chapter 11] Import error; ModuleNotFoundError: No module named 'flair'

Hello.

On Google Colab, I installed necessary packages for chapter11 using below pip commands and tried to import them. But I got an error below.

pip commands

!pip install gensim==3.8.3
!pip install allennlp==0.9.0
!pip install flair==0.8.0.post1 # uses PyTorch 1.7.1
!pip install torchvision==0.8.2
# HuggingFace
!pip install transformers==4.5.1
!pip install datasets==1.6.0

import code

import os
import json
import errno
import requests
import numpy as np
from copy import deepcopy
from operator import itemgetter

import torch
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, TensorDataset, Dataset

from data_generation.nlp import ALICE_URL, WIZARD_URL, download_text
from stepbystep.v4 import StepByStep
# These are the classes we built in Chapter 10
from seq2seq import *

import nltk
from nltk.tokenize import sent_tokenize

import gensim
from gensim import corpora, downloader
from gensim.parsing.preprocessing import *
from gensim.utils import simple_preprocess
from gensim.models import Word2Vec

from flair.data import Sentence
from flair.embeddings import ELMoEmbeddings, WordEmbeddings, \
    TransformerWordEmbeddings, TransformerDocumentEmbeddings

from datasets import load_dataset, Split
from transformers import (
    DataCollatorForLanguageModeling,
    BertModel, BertTokenizer, BertForSequenceClassification,
    DistilBertModel, DistilBertTokenizer,
    DistilBertForSequenceClassification,
    AutoModelForSequenceClassification,
    AutoModel, AutoTokenizer, AutoModelForCausalLM,
    Trainer, TrainingArguments, pipeline, TextClassificationPipeline
)
from transformers.pipelines import SUPPORTED_TASKS

Error

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-4-d2e06031a8c5>](https://localhost:8080/#) in <cell line: 29>()
     27 from gensim.models import Word2Vec
     28 
---> 29 from flair.data import Sentence
     30 from flair.embeddings import ELMoEmbeddings, WordEmbeddings, \
     31     TransformerWordEmbeddings, TransformerDocumentEmbeddings

ModuleNotFoundError: No module named 'flair'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
Here’s the installation log. Collecting gensim==3.8.3 Downloading gensim-3.8.3.tar.gz (23.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23.4/23.4 MB 31.6 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Requirement already satisfied: numpy>=1.11.3 in /usr/local/lib/python3.10/dist-packages (from gensim==3.8.3) (1.23.5) Requirement already satisfied: scipy>=0.18.1 in /usr/local/lib/python3.10/dist-packages (from gensim==3.8.3) (1.10.1) Requirement already satisfied: six>=1.5.0 in /usr/local/lib/python3.10/dist-packages (from gensim==3.8.3) (1.16.0) Requirement already satisfied: smart_open>=1.8.1 in /usr/local/lib/python3.10/dist-packages (from gensim==3.8.3) (6.3.0) Building wheels for collected packages: gensim error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for gensim (setup.py) ... error
ERROR: Failed building wheel for gensim
Running setup.py clean for gensim
Failed to build gensim
ERROR: Could not build wheels for gensim, which is required to install pyproject.toml-based projects
Collecting allennlp==0.9.0
Downloading allennlp-0.9.0-py3-none-any.whl (7.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.6/7.6 MB 16.4 MB/s eta 0:00:00
Requirement already satisfied: torch>=1.2.0 in /usr/local/lib/python3.10/dist-packages (from allennlp==0.9.0) (2.0.1+cu118)
Collecting overrides (from allennlp==0.9.0)
Downloading overrides-7.4.0-py3-none-any.whl (17 kB)
Requirement already satisfied: nltk in /usr/local/lib/python3.10/dist-packages (from allennlp==0.9.0) (3.8.1)
Collecting spacy<2.2,>=2.1.0 (from allennlp==0.9.0)
Downloading spacy-2.1.9.tar.gz (30.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30.7/30.7 MB 38.4 MB/s eta 0:00:00
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Installing build dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Collecting flair==0.8.0.post1
Downloading flair-0.8.0.post1-py3-none-any.whl (284 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 284.8/284.8 kB 4.8 MB/s eta 0:00:00
Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/lib/python3.10/dist-packages (from flair==0.8.0.post1) (2.8.2)
INFO: pip is looking at multiple versions of flair to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement torch<=1.7.1,>=1.5.0 (from flair) (from versions: 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 2.0.0, 2.0.1)
ERROR: No matching distribution found for torch<=1.7.1,>=1.5.0
ERROR: Could not find a version that satisfies the requirement torchvision==0.8.2 (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2)
ERROR: No matching distribution found for torchvision==0.8.2
Collecting transformers==4.5.1
Downloading transformers-4.5.1-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 8.9 MB/s eta 0:00:00
Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers==4.5.1) (3.12.2)
Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from transformers==4.5.1) (1.23.5)
Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from transformers==4.5.1) (23.1)
Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers==4.5.1) (2023.6.3)
Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from transformers==4.5.1) (2.31.0)
Collecting sacremoses (from transformers==4.5.1)
Downloading sacremoses-0.0.53.tar.gz (880 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 880.6/880.6 kB 14.0 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting tokenizers<0.11,>=0.10.1 (from transformers==4.5.1)
Downloading tokenizers-0.10.3.tar.gz (212 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 212.7/212.7 kB 15.8 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from transformers==4.5.1) (4.66.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.5.1) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.5.1) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.5.1) (2.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.5.1) (2023.7.22)
Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from sacremoses->transformers==4.5.1) (1.16.0)
Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from sacremoses->transformers==4.5.1) (8.1.7)
Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from sacremoses->transformers==4.5.1) (1.3.2)
Building wheels for collected packages: tokenizers, sacremoses
error: subprocess-exited-with-error

× Building wheel for tokenizers (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for tokenizers (pyproject.toml) ... error
ERROR: Failed building wheel for tokenizers
Building wheel for sacremoses (setup.py) ... done
Created wheel for sacremoses: filename=sacremoses-0.0.53-py3-none-any.whl size=895241 sha256=3fcf65ccb41363bbf5a10c5d759cebc935827085d5004ebeffef4ef3feeb8f31
Stored in directory: /root/.cache/pip/wheels/00/24/97/a2ea5324f36bc626e1ea0267f33db6aa80d157ee977e9e42fb
Successfully built sacremoses
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects
Collecting datasets==1.6.0
Downloading datasets-1.6.0-py3-none-any.whl (202 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 202.2/202.2 kB 3.5 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from datasets==1.6.0) (1.23.5)
Requirement already satisfied: pyarrow>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from datasets==1.6.0) (9.0.0)
Collecting dill (from datasets==1.6.0)
Downloading dill-0.3.7-py3-none-any.whl (115 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 115.3/115.3 kB 7.0 MB/s eta 0:00:00
Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from datasets==1.6.0) (1.5.3)
Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.10/dist-packages (from datasets==1.6.0) (2.31.0)
Collecting tqdm<4.50.0,>=4.27 (from datasets==1.6.0)
Downloading tqdm-4.49.0-py2.py3-none-any.whl (69 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 69.8/69.8 kB 7.5 MB/s eta 0:00:00
Collecting xxhash (from datasets==1.6.0)
Downloading xxhash-3.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 194.1/194.1 kB 8.1 MB/s eta 0:00:00
Collecting multiprocess (from datasets==1.6.0)
Downloading multiprocess-0.70.15-py310-none-any.whl (134 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 134.8/134.8 kB 6.1 MB/s eta 0:00:00
Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from datasets==1.6.0) (2023.6.0)
Collecting huggingface-hub<0.1.0 (from datasets==1.6.0)
Downloading huggingface_hub-0.0.19-py3-none-any.whl (56 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.9/56.9 kB 6.6 MB/s eta 0:00:00
Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from datasets==1.6.0) (23.1)
Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.1.0->datasets==1.6.0) (3.12.2)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.1.0->datasets==1.6.0) (6.0.1)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.1.0->datasets==1.6.0) (4.7.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets==1.6.0) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets==1.6.0) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets==1.6.0) (2.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets==1.6.0) (2023.7.22)
Requirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets==1.6.0) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets==1.6.0) (2023.3)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.1->pandas->datasets==1.6.0) (1.16.0)
Installing collected packages: xxhash, tqdm, dill, multiprocess, huggingface-hub, datasets
Attempting uninstall: tqdm
Found existing installation: tqdm 4.66.1
Uninstalling tqdm-4.66.1:
Successfully uninstalled tqdm-4.66.1
Successfully installed datasets-1.6.0 dill-0.3.7 huggingface-hub-0.0.19 multiprocess-0.70.15 tqdm-4.49.0 xxhash-3.3.0

It seems that a few things have changed since last update. According to the AllenNLP’s official repo, the library is now in maintenance mode. PyTorch 1.7.1 used flair==0.8.0.post1 is no longer available via pip.

I want to work with these fancy packages, torchtext, fastText or something, but I have few idea to solve this dependency problem. Could you give me some help?

Chapter 8 > Gated Recurrent Units (GRUs) > Visualizing the Model > The Journey of a Gated Hidden State: figure22 error

Hi,
Figure22 is throwing the following error:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[100], line 1
----> 1 fig = figure22(model.basic_rnn)

File ~/side_projects/brain_auth/psychopy/data_alcoholism/PyTorchStepByStep/plots/chapter8.py:880, in figure22(rnn)
    878 square = torch.tensor([[-1, -1], [-1, 1], [1, 1], [1, -1]]).float().view(1, 4, 2)
    879 n_linear, r_linear, z_linear = disassemble_gru(rnn, layer='_l0')
--> 880 gcell, mstates, hstates, gates = generate_gru_states(n_linear, r_linear, z_linear, square)
    881 gcell(hstates[-1])
    882 titles = [r'$hidden\ state\ (h)$',
    883           r'$transformed\ state\ (t_h)$',
    884           r'$reset\ gate\ (r*t_h)$' + '\n' + r'$r=$',
   (...)
    888           r'$adding\ z*h$' + '\n' + r'h=$(1-z)*n+z*h$', 
    889          ]

File ~/side_projects/brain_auth/psychopy/data_alcoholism/PyTorchStepByStep/plots/chapter8.py:787, in generate_gru_states(n_linear, r_linear, z_linear, X)
    785     gcell = add_h(gcell, z*hidden)
    786     model_states.append(deepcopy(gcell.state_dict()))
--> 787     hidden = gcell(hidden)
    789 return gcell, model_states, hidden_states, {'rmult': rs, 'zmult': zs}

File ~/side_projects/brain_auth/psychopy/data_alcoholism/venv/lib/python3.8/site-packages/torch/nn/modules/module.py:1190, in Module._call_impl(self, *input, **kwargs)
   1186 # If we don't have any hooks, we want to skip the rest of the logic in
   1187 # this function, and just call forward.
   1188 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1189         or _global_forward_hooks or _global_forward_pre_hooks):
-> 1190     return forward_call(*input, **kwargs)
   1191 # Do not call functions when jit is used
   1192 full_backward_hooks, non_full_backward_hooks = [], []

File ~/side_projects/brain_auth/psychopy/data_alcoholism/venv/lib/python3.8/site-packages/torch/nn/modules/container.py:204, in Sequential.forward(self, input)
    202 def forward(self, input):
    203     for module in self:
--> 204         input = module(input)
    205     return input

File ~/side_projects/brain_auth/psychopy/data_alcoholism/venv/lib/python3.8/site-packages/torch/nn/modules/module.py:1190, in Module._call_impl(self, *input, **kwargs)
   1186 # If we don't have any hooks, we want to skip the rest of the logic in
   1187 # this function, and just call forward.
   1188 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1189         or _global_forward_hooks or _global_forward_pre_hooks):
-> 1190     return forward_call(*input, **kwargs)
   1191 # Do not call functions when jit is used
   1192 full_backward_hooks, non_full_backward_hooks = [], []

File ~/side_projects/brain_auth/psychopy/data_alcoholism/venv/lib/python3.8/site-packages/torch/nn/modules/linear.py:114, in Linear.forward(self, input)
    113 def forward(self, input: Tensor) -> Tensor:
--> 114     return F.linear(input, self.weight, self.bias)

RuntimeError: expand(torch.FloatTensor{[1, 1, 2]}, size=[1, 2]): the number of sizes provided (2) must be greater or equal to the number of dimensions in the tensor (3)

I have tested in local and colab, but the same error happens.

importing data_generation.square_sequences failing

I am getting following when I try import, any idea???

[root@localhost PyTorchStepByStep]# python3 -c "import data_generation.square_sequences"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'data_generation.square_sequences'

I made similar boilerplate code dir1/dir1a.py and it works:

python3 -c "import dir1.dir1a"
[root@localhost PyTorchStepByStep]# cat dir1/dir1a.py


def dir1a():
    print("dir1a:")

[root@localhost PyTorchStepByStep]# git remote -v
origin  https://github.com/dvgodoy/PyTorchStepByStep.git (fetch)
origin  https://github.com/dvgodoy/PyTorchStepByStep.git (push)
[root@localhost PyTorchStepByStep]# pwd
/root/gg/git/codelab/gpu/ml/tf/tf-from-scratch/3/PyTorchStepByStep

/root/gg/git/codelab/gpu/ml/tf/tf-from-scratch/3/PyTorchStepByStep
[root@localhost PyTorchStepByStep]# uname -r
6.1.77kernel_org
[root@localhost PyTorchStepByStep]# cat /etc/os-release | grep -i cent
NAME="CentOS Stream"
ID="centos"
PRETTY_NAME="CentOS Stream 9"
CPE_NAME="cpe:/o:centos:centos:9"
HOME_URL="https://centos.org/"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
[root@localhost PyTorchStepByStep]# pip3 list | grep torch
pytorch-triton-rocm 2.1.0+dafe145982
torch               2.2.0.dev20231209+rocm5.7
torchaudio          2.2.0.dev20231209+rocm5.7
torchbench          0.1                        /root/gg/git/benchmark
torchvision         0.17.0.dev20231209+rocm5.7


The use of "log" vs "ln", chapter 3 - Loss

I hope that this is not trivial. I was confused by it for a while so I thought that I should bring it up.

Normally, in engineering, when I see Log, without any base, it is assumed to be logarithm to the base 10. In the following from chapter 3, Loss
first_summation = torch.log(positive_pred).sum()

Printing this first summation I noticed the value = tensor(-0.1054)
I was going though the math and realized that this is not equal to log 10 of .9, which is -.045.

Going to the pytorch documentation I saw that "log Returns a new tensor with the natural logarithm of the elements of input."

Of course, in the "From Logits to Probablilties" there is shown the relationship which "kind of" hints towards natural logarithms or log to the base e, but the whole confusion can be avoided by using the symbol "ln" as opposed to "log".

Do you agree?

Thank You
Tom

Typo Figure 0.6

Hi there,

not sure if it's the right place, but it's the easiest one for me :)

In Figure 0.6 in your book the diagrams has "w" on is x-axis instead of "b".

Great book, hopefully there will be more content soon :)

Possibly some typos in the book

Here is Eq 5.6 in the book:
Snipaste_2024-03-19_15-53-50

It is stated that "C stands for the number of classes". I think the Nc, which represents the number of cases in the cth class, should be replaced by C. Nc is simply irrelevant here since softmax is calucated per individual.

Please correct me if I am wrong. Thank you.

Patrick Wen

On the calculation of "w_grad".

In chapter0 and chapter1 there are a couple of calculations for the gradient of b and the gradient of w.

Given that yhat = b +w(x_train), where b is random and error is (yhat -y_train), that makes error = (b +w(x_train) - y_train).

b_grad is given as 2(error.mean() ) which is 2(b + w(x_train) - y_train).mean() , so it seems to me, and I could be wrong, that the so called gradient of b also includes a healthy helping of w.

w_grad is given as 2(x_train(error).mean() )
which expands out to 2((x_train)b + (x_train**2)w - (x_train)(y_train)).mean() )

It is the (x_train)**2 term that triggered something in my mind. As well as the fact that the w_grad term also has a healthy helping of b.

My intuition, and I could be wrong here, is that there is a partial derivative missing such that the gradient of b would be based upon differentiating b while holding w constant and similarly, the gradient of w would be done with holding b as a constant.

Also, the (x_train)**2 term is confusing here.

I would be deeply grateful for a clarification.

Thank You
Tom

Link 35 is broken

Another thing I found in the book, link 35 doesn't seem to work.

Thanks! :)

Chapter00:- ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

Hello,
I am getting the error in following code

figure3(x_train, y_train, b, w)

error is

ValueError                                Traceback (most recent call last)
Cell In[11], line 1
----> 1 figure3(x_train, y_train, b, w)

File ~/AIMLDL/Pytorch basic 2/PyTorchStepByStep/plots/chapter0.py:79, in figure3(x_train, y_train, b, w)
     77 ax.scatter([x0], [y0], c='r')
     78 # Vertical line showing error between point and prediction
---> 79 ax.plot([x0, x0], [b + w * x0, y0 - .03], c='r', linewidth=2, linestyle='--')
     80 ax.arrow(x0, y0 - .03, 0, .03, color='r', shape='full', lw=0, length_includes_head=True, head_width=.03)
     81 ax.arrow(x0, b + w * x0 + .05, 0, -.03, color='r', shape='full', lw=0, length_includes_head=True, head_width=.03)

File /usr/lib/python3/dist-packages/matplotlib/axes/_axes.py:1632, in Axes.plot(self, scalex, scaley, data, *args, **kwargs)
   1390 """
   1391 Plot y versus x as lines and/or markers.
   1392 
   (...)
   1629 (``'green'``) or hex strings (``'#008000'``).
   1630 """
   1631 kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
-> 1632 lines = [*self._get_lines(*args, data=data, **kwargs)]
   1633 for line in lines:
   1634     self.add_line(line)

File /usr/lib/python3/dist-packages/matplotlib/axes/_base.py:312, in _process_plot_var_args.__call__(self, data, *args, **kwargs)
    310     this += args[0],
    311     args = args[1:]
--> 312 yield from self._plot_args(this, kwargs)

File /usr/lib/python3/dist-packages/matplotlib/axes/_base.py:488, in _process_plot_var_args._plot_args(self, tup, kwargs, return_kwargs)
    486 if len(xy) == 2:
    487     x = _check_1d(xy[0])
--> 488     y = _check_1d(xy[1])
    489 else:
    490     x, y = index_of(xy[-1])

File /usr/lib/python3/dist-packages/matplotlib/cbook/__init__.py:1304, in _check_1d(x)
   1302 """Convert scalars to 1D arrays; pass-through arrays as is."""
   1303 if not hasattr(x, 'shape') or len(x.shape) < 1:
-> 1304     return np.atleast_1d(x)
   1305 else:
   1306     try:
   1307         # work around
   1308         # https://github.com/pandas-dev/pandas/issues/27775 which
   (...)
   1319         # This code should correctly identify and coerce to a
   1320         # numpy array all pandas versions.

File ~/.local/lib/python3.10/site-packages/numpy/core/shape_base.py:65, in atleast_1d(*arys)
     63 res = []
     64 for ary in arys:
---> 65     ary = asanyarray(ary)
     66     if ary.ndim == 0:
     67         result = ary.reshape(1)

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. ````

Structure of torchvision.models has changed

Hi,

I'm using torchvision 0.15.2. When I study chapter 7 transfer learning, I find that the structure of torchvision.models is changed and some code in the book now has problems.

For example, the model_urls method is deprecated and can't be imported. In addition, alexnet(pretrained=False) gives warning. Now, one should use the Weight object, like resnet50(weights=ResNet50_Weights.IMAGENET1K_V1).

Will you update chapter 7 in the near future to reflect these new features?

Thank you very much.

A simple question about how you are using matplotlib?

Hi, and i realize that this may be trivial.

In your "figures" you are using python functions that are defined in the "plots" directory.

In the jupyter notebook you use
figure1(x_train, y_train, x_val, y_val

This calls the function
`def figure1(x_train, y_train, x_val, y_val):
fig, ax = plt.subplots(1, 2, figsize=(12, 6))

ax[0].scatter(x_train, y_train)
ax[0].set_xlabel('x')
ax[0].set_ylabel('y')
ax[0].set_ylim([0, 3.1])
ax[0].set_title('Generated Data - Train')

ax[1].scatter(x_val, y_val, c='r')
ax[1].set_xlabel('x')
ax[1].set_ylabel('y')
ax[1].set_ylim([0, 3.1])
ax[1].set_title('Generated Data - Validation')
fig.tight_layout()

return fig, ax

`
I notice that there is no plt.show() statement that is needed, either in the function or in the jupyter notebook.

However, if I am at the command line (not using the jupyter notebook) and I enter the python code line by line and make the "figure" call, I don't get a plot unless I use "plt.show()" as the next line after the figure call.

Can you tell me why plt.show() is not necessary for the jupyter notebook but it is necessary when calling the function from the command line?

Thank You
Tom

Chapter 11, p 910: missing assignment in code

On page 910 in the code example you see the following code example

sentence1 = 'follow the white rabbit neo'
sentence2 = 'no one can be told what the matrix is'
tokenizer(sentence1, sentence2)

Later the variable joined_sentences is used, but the assignment is missing.

The correct version is in the corresponding jupyter notebook:

sentence1 = 'follow the white rabbit neo'
sentence2 = 'no one can be told what the matrix is'
joined_sentences = tokenizer(sentence1, sentence2)
joined_sentences

How does nn.conv2D implement the feature map table of LeNet-5?

I have been going through the pytorch documentation of conv2D. Reading the docs from pytorch I see

torch.nn.Conv2d(in_channels: int, out_channels: int, kernel_size: Union[T, Tuple[T, T]], stride: Union[T, Tuple[T, T]] = 1, padding: Union[T, Tuple[T, T]] = 0, dilation: Union[T, Tuple[T, T]] = 1, groups: int = 1, bias: bool = True, padding_mode: str = 'zeros')

From the LeNet paper of November 1998 I see that the third convolution layer is implemented with 6 input layers and 16 output layers. The 16 output layers are made from a combination of the 6 input layers according to a table, also in the paper:

LenetFeatureMap

From the chapter 5 tutorial, C3 is implemented with

lenet.add_module('C3', nn.Conv2d(in_channels=6, out_channels=16, kernel_size=5))

What I do not see is how pytorch implements this feature map table. It seems a little like a "loaves and fishes" issue :-).

P.S. If I might kill two birds with one stone, can i ask which plots are being implemented with IPython? I have observed that usually the plots that you generate are implemented in the plots directories from each chapter, using matplotlib. I was looking for HTML plots that were generated with IPython, because you call the IPython.core.display module and import display, HTML. But, I could not seem to spot how it was used.

Thank You
Tom

PyTorchStepByStep is under advertised.

Danial, I wanted to let you know that I am really finding your Tutorial Series very helpful but you could be selling it a bit better.

  1. I am finding the tutorial a fantastic help in terms of learning numpy. Yes, the CS231 numpy tutorial give a good starting point but there is very little of practical use compared to what is in PyTorchStepByStep.

  2. Your tutorial provides a good learning point for matplotlib. I was forced to dig through the functions which generated the figures. I got everything working inside and outside of a python notebook.

I just wanted to let you know how much I appreciate this tutorial.

Tom

Chapter 8, figure 8.6

Dear Daniel,

first of all: Great book! I do enjoy reading it!
In Figure 8.6 for the input x and the hidden-input y both vectors are transformed with the weight matrix W. It looks like both are sharing the same weight matrix. Maybe it would be better to use Wi and Wh instead, to make clear that these are different weight matrices.

Best
Benjamin

How to extract/save weights after training?

OK, here I am displaying my utter ignorance again. I did find a post on towards data science entitled "everything you need to know about saving weights in pytorch".

https://towardsdatascience.com/everything-you-need-to-know-about-saving-weights-in-pytorch-572651f3f8de

Now I am stuck. Having saved the weights in the example project, I am aware that the file is not in a human readable format.

So my question now becomes is there a way to take this file of weights which is in pth format and convert it to numpy, which would be human readable? I would like to be able to do further manipulation of the weights in numpy.

Thank You for your patients
Tom

Everything works locally, except figure graphics

Hi, My usual practice when learning from python notebooks is to get everything that would work in the notebook to work locally.

What program is used to generate the figures? Clearly, something not local in the notebook. Perhaps something called from google colab?

I have installed everything properly and the data output is correct. However, I can't get the figures to display, locally. I did install matplotlib but I don't know how to get the same graphics to generate as are generated via the python notebook .

figure1(x_train, y_train, x_val, y_val) gives me

(<Figure size 864x432 with 2 Axes>,
(<matplotlib.axes._subplots.Axes3DSubplot at 0x7fc942d92fd0>,
<matplotlib.axes._subplots.AxesSubplot at 0x7fc9430497d0>))

Just like it does in the jupyter notebook but with no picture. I know that I have to get some kind of graphical engine going as is going in the notebook but I don't know which one to start.

I realize that this is a pretty minor issue.

Thank You
Tom

TransformedTensorDataset needs a seed

After seeing some inconsistencies with TransformedTensorDataset, finally found the solution:

class TransformedTensorDataset(Dataset):
    def __init__(self, x, y, transform=None, seed=42):
        self.x = x
        self.y = y
        self.transform = transform
        self.seed = seed
        
    def __getitem__(self, index):
        x = self.x[index]
        
        random.seed(self.seed)
        torch.manual_seed(self.seed)

        if self.transform:
            x = self.transform(x)
        
        return x, self.y[index]
        
    def __len__(self):
        return len(self.x)

Went from "train_step" in helper fn 1, to "step" in helper fn 2?

I am missing the place where "step" is used as the returned function to "train_step"

First:
train_step = make_train_step(model, loss_fn, optimizer) loss = **train_step**(x_train_tensor, y_train_tensor)

In model_training/v2.py we see
mini_batch_loss = **train_step**(x_batch, y_batch)

in helper function #2 we see
mini_batch_loss = **step**(x_batch, y_batch)

So far, I have been able to follow the thread of higher level functions. But I missed the above.

Thank You
Tom

Chapter 01 - negative sign for gradients

Prior to "Linear Regression in Numpy" section you do not add a negative sign in front of calculated gradients, while you do so later. I believe later is correct as gradients need to point towards the minima. Is that right?

kindle eBook: readability issues on eink devices

The kindle version of the book is hard to read on a physical kindle eink device due to lack of contrast.
The bulk text of the book is dark grey instead of a saturated black.

I can reproduce the effect using the kindle web reader as well.
See below for a screenshot from an ebook rendering well on the top,
and from Vol I setup chapter on the bottom.

The text's color renders as #333332 instead of #000000.
Nice on desktop display, but weird on eink reader.

kindle

ImageFolder: a generic dataset or data loader?

Here is a description of ImageFolder in Page 419 of the book:
Snipaste_2024-03-21_15-52-32

In contrast to the above description of ImageFolder as a "generic dataset", the PyTorch user manual describes ImageFolder as "A generic data loader where the images are arranged in this way by default ...". I feel ImageFolder functions like TensorDataset but is specifically for image data. I am not sure whether to call it a generic dataset or generic data loader.

All I know about PyTorch is from this book for the moment and I am just on my way of learning. Any clarification is appreciated. Thank you.

The use of the module `data_generation` in chapter 4

Chapter 4, when defining Imports
from data_generation.image_classification import generate_dataset

In the data_generation package as of 15/11/23, the sub_module image_classification no longer seems to exist. Are there any alternatives, so I may proceed with the chapter?

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.