Skip to content

Instantly share code, notes, and snippets.

View affjljoo3581's full-sized avatar

Jungwoo Park affjljoo3581

  • Kwangwoon University
  • Seoul, South Korea
View GitHub Profile
{"src": [359, 368, 460, 475, 486, 492, 496, 514, 516, 525, 547, 548, 556, 563, 575, 641, 648, 723, 733, 765, 801, 826, 852, 858, 878, 896, 900, 905, 908, 910, 935, 946, 947, 994, 999, 1003, 1005, 1010, 1027, 1029, 1048, 1055, 1064, 1065, 1069, 1075, 1079, 1081, 1085, 1088, 1093, 1106, 1143, 1144, 1145, 1147, 1168, 1171, 1178, 1187, 1190, 1197, 1205, 1216, 1223, 1230, 1236, 1241, 1245, 1257, 1259, 1260, 1267, 1268, 1269, 1271, 1272, 1273, 1277, 1303, 1344, 1349, 1355, 1357, 1384, 1388, 1391, 1427, 1429, 1432, 1437, 1450, 1461, 1462, 1474, 1502, 1503, 1512, 1552, 1555, 1577, 1584, 1587, 1589, 1599, 1615, 1616, 1681, 1692, 1701, 1716, 1729, 1757, 1759, 1764, 1777, 1786, 1822, 1841, 1842, 1848, 1850, 1856, 1860, 1861, 1864, 1876, 1897, 1898, 1910, 1913, 1918, 1922, 1928, 1932, 1935, 1947, 1951, 1953, 1970, 1977, 1979, 2001, 2017, 2067, 2081, 2087, 2112, 2128, 2135, 2147, 2174, 2175, 2176, 2177, 2178, 2181, 2183, 2184, 2187, 2189, 2190, 2191, 2192, 2193, 2197, 2202, 2203, 2206, 2208, 2209, 2211, 2212, 2213, 2214,
@affjljoo3581
affjljoo3581 / main.py
Created September 14, 2020 13:00
Test code for KoSpeech Transformer model.
import torch
from kospeech.models.acoustic.transformer.transformer import SpeechTransformer
from kospeech.criterion.label_smoothed_cross_entropy import LabelSmoothedCrossEntropyLoss
transformer = SpeechTransformer(
num_classes=128, d_model=64, input_dim=80, pad_id=0, eos_id=3, d_ff=256,
num_heads=8, num_encoder_layers=2, num_decoder_layers=2, dropout_p=0.1)
criterion = LabelSmoothedCrossEntropyLoss(
num_classes=1024, ignore_index=0, smoothing=0.1, reduction='mean',
import numpy as np
import tensorflow as tf
BEFORE_NUMBER = 3
BATCH_SIZE = 512
STEPS = 100000
LOG_STEP = 1000