SMALLDATASCIENCE Telegram 813
#код
Вот вам простейшая, но хорошая для собеседования DL-исследователей/инженеров задача. Попробуйте решить сами прежде, чем посмотреть ответ.

Даны два тензора - X размера MxN и Y размера KxN, нужно получить тензор размера MxK, ij-й элемент которого норма разности i-й строки X и j-й строки Y.

Понятно, что задачка возникает на практике и должна решаться на автомате;)

Пример: для входа
tensor([[0., 0., 0., 0.],
[1., 1., 1., 1.],
[1., 2., 3., 4.]])
tensor([[1., 0., 0., 0.],
[0., 0., 0., 1.]])

выход
tensor([[1.0000, 1.0000],
[1.7321, 1.7321],
[5.3852, 4.7958]])

Решение (для PyTorch): (X.unsqueeze(1) - Y).norm(dim=2)
👍60👏4



tgoop.com/smalldatascience/813
Create:
Last Update:

#код
Вот вам простейшая, но хорошая для собеседования DL-исследователей/инженеров задача. Попробуйте решить сами прежде, чем посмотреть ответ.

Даны два тензора - X размера MxN и Y размера KxN, нужно получить тензор размера MxK, ij-й элемент которого норма разности i-й строки X и j-й строки Y.

Понятно, что задачка возникает на практике и должна решаться на автомате;)

Пример: для входа

tensor([[0., 0., 0., 0.],
[1., 1., 1., 1.],
[1., 2., 3., 4.]])
tensor([[1., 0., 0., 0.],
[0., 0., 0., 1.]])

выход
tensor([[1.0000, 1.0000],
[1.7321, 1.7321],
[5.3852, 4.7958]])

Решение (для PyTorch): (X.unsqueeze(1) - Y).norm(dim=2)

BY Small Data Science for Russian Adventurers


Share with your friend now:
tgoop.com/smalldatascience/813

View MORE
Open in Telegram


Telegram News

Date: |

The group also hosted discussions on committing arson, Judge Hui said, including setting roadblocks on fire, hurling petrol bombs at police stations and teaching people to make such weapons. The conversation linked to arson went on for two to three months, Hui said. The court said the defendant had also incited people to commit public nuisance, with messages calling on them to take part in rallies and demonstrations including at Hong Kong International Airport, to block roads and to paralyse the public transportation system. Various forms of protest promoted on the messaging platform included general strikes, lunchtime protests and silent sit-ins. 4How to customize a Telegram channel? Select: Settings – Manage Channel – Administrators – Add administrator. From your list of subscribers, select the correct user. A new window will appear on the screen. Check the rights you’re willing to give to your administrator. 5Telegram Channel avatar size/dimensions
from us


Telegram Small Data Science for Russian Adventurers
FROM American