четверг, 19 ноября 2020 г.
среда, 18 ноября 2020 г.
PyTorch, Values
Continuous, ordinal, and categorical values
We should be aware of three different kinds of numerical values as we attempt to
make sense of our data.3 The first kind is continuous values. These are the most intuitive
when represented as numbers. They are strictly ordered, and a difference
between various values has a strict meaning. Stating that package A is 2 kilograms
heavier than package B, or that package B came from 100 miles farther away than A
has a fixed meaning, regardless of whether package A is 3 kilograms or 10, or if B
came from 200 miles away or 2,000. If you’re counting or measuring something with
units, it’s probably a continuous value. The literature actually divides continuous values
further: in the previous examples, it makes sense to say something is twice as
heavy or three times farther away, so those values are said to be on a ratio scale.
The time of day, on the other hand, does have the notion of difference, but it is not
reasonable to claim that 6:00 is twice as late as 3:00; so time of day only offers an
interval scale.
Next we have ordinal values. The strict ordering we have with continuous values
remains, but the fixed relationship between values no longer applies. A good example
of this is ordering a small, medium, or large drink, with small mapped to the value 1,
medium 2, and large 3. The large drink is bigger than the medium, in the same way
that 3 is bigger than 2, but it doesn’t tell us anything about how much bigger. If we
were to convert our 1, 2, and 3 to the actual volumes (say, 8, 12, and 24 fluid
ounces), then they would switch to being interval values. It’s important to remember
that we can’t “do math” on the values outside of ordering them; trying to average
large = 3 and small = 1 does not result in a medium drink!
Finally, categorical values have neither ordering nor numerical meaning to their values.
These are often just enumerations of possibilities assigned arbitrary numbers. Assigning
water to 1, coffee to 2, soda to 3, and milk to 4 is a good example. There’s no
real logic to placing water first and milk last; they simply need distinct values to differentiate
them. We could assign coffee to 10 and milk to –3, and there would be no
significant change (though assigning values in the range 0..N – 1 will have advantages
for one-hot encoding and the embeddings we’ll discuss in section 4.5.4.) Because
the numerical values bear no meaning, they are said to be on a nominal scale.
______________________________________________________________________________
Important
Непрерывные, порядковые и категориальные значения
Мы должны знать о трех различных видах числовых значений, когда пытаемся
разобраться в наших данных3. Первый вид - это непрерывные значения. Это самые интуитивно понятные
когда они представлены в виде чисел. Они строго упорядочены, и разница
между различными значениями имеет строгое значение. Заявление о том, что пакет А составляет 2 килограмма
тяжелее, чем пакет B, или этот пакет B прибыл на 100 миль дальше, чем A
имеет фиксированное значение, независимо от того, весит ли пакет A 3 килограмма или 10, или если B
приехал из 200 миль или 2000. Если вы что-то считаете или измеряете
единиц, вероятно, это непрерывное значение. Литература фактически разделяет непрерывные значения
далее: в предыдущих примерах имеет смысл сказать, что что-то вдвое больше
тяжелее или в три раза дальше, поэтому считается, что эти значения относятся к шкале отношений.
Время суток, с другой стороны, имеет понятие разницы, но это не так.
разумно утверждать, что 6:00 вдвое позже 3:00; поэтому время суток предлагает только
интервальная шкала.
Далее у нас порядковые значения. У нас строгий порядок с непрерывными значениями
остается, но фиксированная связь между значениями больше не применяется. Хороший пример
из этого - заказ маленького, среднего или большого напитка с малым, сопоставленным со значением 1,
средний 2 и большой 3. Большой напиток больше среднего, точно так же
что 3 больше 2, но ничего не говорит нам о том, насколько больше. Если мы
должны были преобразовать наши 1, 2 и 3 в фактические объемы (скажем, 8, 12 и 24 жидкости
унций), то они переключатся на интервальные значения. Важно помнить
что мы не можем «вычислять» значения, не упорядочивая их; пытаясь усреднить
большой = 3 и маленький = 1 не дает средний напиток!
Наконец, категориальные значения не имеют ни упорядочения, ни числового значения для своих значений.
Часто это просто перечисление возможностей, которым присвоены произвольные номера. Назначение
вода - 1, кофе - 2, газировка - 3, молоко - 4 - хороший пример. Нет никаких
реальная логика размещения воды в первую очередь и молока в последнюю очередь; им просто нужны разные значения, чтобы различать
их. Мы могли бы присвоить кофе значение 10, а молоко - –3, и не было бы
существенное изменение (хотя присвоение значений в диапазоне 0..N - 1 будет иметь преимущества
для быстрого кодирования и встраивания мы обсудим в разделе 4.5.4.) Потому что
числовые значения не имеют смысла, они, как говорят, находятся в номинальной шкале.
вторник, 17 ноября 2020 г.
NN, RL, Deep Learnig Course, DeepLizard,
RL
https://www.youtube.com/watch?v=nyjbcRQ-uQ8&list=PLZbbT5o_s2xoWNVdDudn51XM8lOuZ_Njv&index=1
https://deeplizard.com/learn/playlist/PLZbbT5o_s2xoWNVdDudn51XM8lOuZ_Njv
PyTorch Prerequisites - Syllabus for Neural Network Programming Course
Deep Learning playlist overview & Machine Learning intro
понедельник, 16 ноября 2020 г.
TensorBoard, Install
Installing TensorBoard can be done with either pip or conda:
pip install tensorboard
conda install tensorboard
PyTorch requires v1.14 or above of TensorBoard.
TensorBoard can then be started on the command line:
tensorboard --logdir=runs
You can then go to http://[your-machine]:6006, where you’ll see the welcome screen
воскресенье, 15 ноября 2020 г.
PyTorch, Install
pip install torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
https://aka.ms/vs/16/release/vc_redist.x64.exe - Обязательно
https://pytorch.org/get-started/locally/
import torch
x = torch.rand(5, 3)
print(x)Examples:
https://pytorch.org/tutorials/beginner/pytorch_with_examples.html
