Skip to content

Spellcheck intermediate 2 python #2291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions .pyspelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,7 @@ matrix:
- name: python
sources:
- beginner_source/*.py
- intermediate_source/autograd_saved_tensors_hooks_tutorial.py
- intermediate_source/ax_multiobjective_nas_tutorial.py
- intermediate_source/char_rnn_classification_tutorial.py
- intermediate_source/char_rnn_generation_tutorial.py
- intermediate_source/custom_function_conv_bn_tutorial.py
- intermediate_source/ensembling.py
#- intermediate_source/flask_rest_api_tutorial.py
- intermediate_source/forward_ad_usage.py
- intermediate_source/fx_conv_bn_fuser.py
- intermediate_source/fx_profiling_tutorial.py
- intermediate_source/jacobians_hessians.py
- intermediate_source/mario_rl_tutorial.py
- intermediate_source/mnist_train_nas.py
- intermediate_source/memory_format_tutorial.py
- intermediate_source/model_parallel_tutorial.py
- intermediate_source/*.py
dictionary:
wordlists:
- en-wordlist.txt
Expand All @@ -30,9 +16,14 @@ matrix:
# Exclude figure rST tags
- open: '\.\.\s+(figure|literalinclude|math|image|grid)::'
close: '\n'
# Exclude roles:
- open: ':(?:(class|py:mod|mod|func)):`'
content: '[^`]*'
close: '`'
# Exclude raw directive
- open: '\.\. (raw)::.*$\n*'
close: '\n'
# Exclude
# Exclude Python coding directives
- open: '-\*- coding:'
close: '\n'
Expand All @@ -46,7 +37,7 @@ matrix:
- open: '(?s)^::\n\n '
close: '^\n'
# Ignore reStructuredText block directives
- open: '\.\. (code-block)::.*$\n*'
- open: '\.\. (code-block|math)::.*$\n*'
content: '(?P<first>(^(?P<indent>[ ]+).*$\n))(?P<other>(^([ \t]+.*|[ \t]*)$\n)*)'
close: '(^(?![ \t]+.*$))'
- pyspelling.filters.markdown:
Expand Down
77 changes: 77 additions & 0 deletions en-wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
APIs
ATen
Args
Autograd
BCE
Expand All @@ -13,38 +14,50 @@ CNNDM
CNNs
CPUs
CUDA
CartPole
Cayley
Chatbots
Colab
Conv
ConvNet
ConvNets
DCGAN
DCGANs
DDP
DDQN
DNN
DQN
DataLoaders
DeepMind
DeiT
DenseNet
EOS
EPS
FC
FGSM
FLAVA
FX
FX's
FloydHub
FloydHub's
Frobenius
GAE
GAN
GANs
GLOO
GPU's
GPUs
GRU
GRUs
GTC
GeForce
Goodfellow
Goodfellow’s
GreedySearchDecoder
HVP
Hugging Face
IMDB
IOT
ImageNet
Initializations
Iteratively
Expand All @@ -56,25 +69,32 @@ Kubernetes
Kuei
LSTM
LSTMs
LeCun
LeNet
LeakyReLU
LeakyReLUs
Lipschitz
Lua
Luong
MLP
MLPs
MNIST
MacBook
Mypy
NAS
NCCL
NCHW
NES
NLP
NTK
NaN
NanoGPT
NeurIPS
NumPy
Numericalization
Numpy's
OpenAI
PPO
Plotly
Prec
Profiler
Expand All @@ -83,31 +103,48 @@ RGB
RL
RNN
RNNs
RPC
RTX
Radford
ReLU
ResNet
SDPA
SGD
SPD
SST2
STN
Sequentials
Sigmoid
SoTA
TPU
TensorBoard
TextVQA
Tokenization
TorchDynamo
TorchInductor
TorchMultimodal
TorchRL
TorchRL's
TorchScript
TorchX
Tunable
UI
Unescape
VQA
VS Code
Wikitext
Xeon
accuracies
activations
adversarially
affine
al
allocator
allocator's
allocators
approximators
autodiff
autoencoder
autograd
backend
backends
Expand All @@ -121,9 +158,13 @@ batchnorm's
benchmarking
boolean
broadcasted
bytecode
cardinality
chatbot
chatbot's
checkpointing
colorbar
compilable
composable
concat
config
Expand All @@ -141,11 +182,17 @@ datapipes
dataset
datasets
dataset’s
deallocation
decorrelated
deserialize
deserialized
deterministically
dimensionality
dir
downsample
downsamples
dropdown
duration
embeddings
encodings
ensembling
Expand All @@ -161,6 +208,7 @@ finetuning
fp
functorch
fuser
geomean
grayscale
hardcode
helpdesk
Expand All @@ -174,16 +222,19 @@ imagenet
initializations
inlined
interpretable
invariance
io
iterable
iteratively
jacobian
jacobians
jit
jpg
judgements
kwargs
labelled
learnable
learnings
loadFilename
manualSeed
matplotlib
Expand All @@ -194,29 +245,39 @@ misclassification
misclassified
modularity
modularized
multihead
multimodal
multimodality
multiobjective
multiprocessed
multithreaded
namespace
natively
ndarrays
num
numericalize
numpy
nvFuser
nvFuser's
optimizable
optimizer's
optimizers
overfitting
parallelizable
parallelization
parametrization
parametrizations
parametrized
parametrizing
perceptibility
pipelining
pointwise
precompute
precomputing
prepend
preprocess
preprocessing
prepruned
prespecified
pretrained
prewritten
Expand All @@ -229,20 +290,28 @@ quantizing
queryable
randint
readably
recomputation
regressor
reimplement
reimplementing
reimplements
reinitializes
relu
reproducibility
rescale
resnet
restride
rewinded
rollout
romanized
runnable
runtime
runtime
runtimes
scalable
softmax
sparsify
specificities
src
stacktrace
stateful
Expand All @@ -252,6 +321,8 @@ subclasses
subclassing
subdirectories
submodule
submodules
subnetworks
subreddit
summarization
tanh
Expand All @@ -262,6 +333,8 @@ timesteps
tokenization
tokenize
tokenizer
tooltip
topologies
torchaudio
torchdata
torchscriptable
Expand All @@ -277,7 +350,11 @@ uncommented
unfused
unimodal
unnormalized
unoptimized
unparametrized
unpickling
unpruned
updation
utils
vectorization
vectorize
Expand Down
6 changes: 3 additions & 3 deletions intermediate_source/flask_rest_api_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ def get_prediction(image_bytes):
#
# .. code-block:: python
#
# import requests
# import requests
#
# resp = requests.post("http://localhost:5000/predict",
# files={"file": open('<PATH/TO/.jpg/FILE>/cat.jpg','rb')})
# resp = requests.post("http://localhost:5000/predict",
# files={"file": open('<PATH/TO/.jpg/FILE>/cat.jpg','rb')})

#######################################################################
# Printing `resp.json()` will now show the following:
Expand Down
12 changes: 6 additions & 6 deletions intermediate_source/neural_tangent_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def forward(self, x):
# we will need a function that accepts the parameters of the model and a single
# input (as opposed to a batch of inputs!) and returns a single output.
#
# We'll use ``torch.func.functional_call``, which allows us to call an nn.Module
# We'll use ``torch.func.functional_call``, which allows us to call an ``nn.Module``
# using different parameters/buffers, to help accomplish the first step.
#
# Keep in mind that the model was originally written to accept a batch of input
Expand Down Expand Up @@ -200,21 +200,21 @@ def func_x2(params):
output, vjp_fn = vjp(func_x1, params)

def get_ntk_slice(vec):
# This computes vec @ J(x2).T
# This computes ``vec @ J(x2).T``
# `vec` is some unit vector (a single slice of the Identity matrix)
vjps = vjp_fn(vec)
# This computes J(X1) @ vjps
# This computes ``J(X1) @ vjps``
_, jvps = jvp(func_x2, (params,), vjps)
return jvps

# Here's our identity matrix
basis = torch.eye(output.numel(), dtype=output.dtype, device=output.device).view(output.numel(), -1)
return vmap(get_ntk_slice)(basis)

# get_ntk(x1, x2) computes the NTK for a single data point x1, x2
# Since the x1, x2 inputs to empirical_ntk_ntk_vps are batched,
# ``get_ntk(x1, x2)`` computes the NTK for a single data point x1, x2
# Since the x1, x2 inputs to ``empirical_ntk_ntk_vps`` are batched,
# we actually wish to compute the NTK between every pair of data points
# between {x1} and {x2}. That's what the vmaps here do.
# between {x1} and {x2}. That's what the ``vmaps`` here do.
result = vmap(vmap(get_ntk, (None, 0)), (0, None))(x1, x2)

if compute == 'full':
Expand Down
Loading