Skip to content

Instantly share code, notes, and snippets.

View pallada-92's full-sized avatar

Yaroslav Sergienko pallada-92

View GitHub Profile
import numpy as np
from utils import load_encoder_hparams_and_params
def softmax(x):
exp_x = np.exp(x - np.max(x, axis=-1, keepdims=True))
return exp_x / np.sum(exp_x, axis=-1, keepdims=True)
def layer_norm(x, g, b, eps: float = 1e-5):
mean = np.mean(x, axis=-1, keepdims=True)
variance = np.var(x, axis=-1, keepdims=True)
@pallada-92
pallada-92 / 0_simple.cul.js
Last active July 23, 2023 19:41
Simple 3d engine implementation in https://github.com/calculang/calculang
/*
Copyright (c) 2023 Yaroslav Sergienko
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@pallada-92
pallada-92 / wordcloud.py
Created June 4, 2020 15:01
Wordcloud example v0.2
import random
terms_sizes = []
terms_labels = []
terms_colors = []
random.seed(0)
for i in range(200):
terms_sizes.append(random.random())
# terms_labels.append(''.join(random.choices(['abcdefgh ', 'cdefg ', 'gh '], k=random.randint(1, 2))).strip())
@pallada-92
pallada-92 / top_commenters_visualization.ipynb
Last active March 22, 2020 22:03
Aura top commenters visualization
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pallada-92
pallada-92 / badges.txt
Last active February 16, 2020 13:26
Яндекс.Музыка
0 - Слушайте плейлист, чтобы цифра на счётчике начала расти
1 - Начинаем отсчёт дней с вашим плейлистом! Включайте сейчас и не забудьте послушать завтра
2 - Два дня подряд. Продолжайте, чтобы не потерять прогресс
3 - Вы слушаете плейлист третий день подряд. Не останавливайтесь!
4 - Уже четыре дня с плейлистом. Не забывайте слушать каждый день!
5 - Пять дней, полёт нормальный! Слушайте дальше, чтобы не потерять прогресс
6 - Идём на рекорд! Послушали сегодня — включайте завтра, чтобы не потерять прогресс
7 - Уже неделя с этим плейлистом. Продолжайте в том же духе!
8 - Восьмой день. Завтра будет девятый, если начнёте день с плейлиста
9 - День № 9. Слушайте сейчас и завтра, чтобы сделать цифру двузначной
@pallada-92
pallada-92 / adjectives.txt
Last active April 3, 2019 19:18
Killer Web App (Google App Engine)
абсолютный
аккуратный
активный
американский
английский
армейский
атомный
багровый
бедный
безнадежный
@pallada-92
pallada-92 / 190105_recur.ipynb
Created January 8, 2019 23:43
Intel-style chips procedural generator
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pallada-92
pallada-92 / 190106_blur.ipynb
Last active August 1, 2020 15:17
HUD-style visulization of a random graph
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# see also this gist for preprocessing source: https://gist.github.com/pallada-92/0c2bb28255b861f2d365de3d2bc8f748
import math
import cairo
cmap = plt.get_cmap('gist_rainbow')
days_of_week = ['Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday', 'Saturday', 'Sunday']
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.