더북(TheBook)
import torch
import torch.nn as nn
import torch.nn.functional as F

# 하이퍼 파라미터
HIDDEN_SIZE = 128
DENSE_HIDDEN_UNITS = 4 * HIDDEN_SIZE
MAX_LEN = 220
EMBED_SIZE = 300
BATCH_SIZE = 512
NB_EPOCHS = 4
LEARNING_RATE = 0.001

CRAWL_EMBEDDING_PATH = (
    "../input/pickled-crawl300d2m/pickled-crawl300d2m/crawl-300d-2M.pkl"
)
AGLOVE_EMBEDDING_PATH = (
    "../input/pickled-glove840b300d/pickled-glove840b300d/glove.840B.300d.pkl"
)

def build_matrix(word_index, path):
    embedding_index = load_embeddings(path)
    embedding_matrix = np.zeros((len(word_index) + 1, EMBED_SIZE))
    unknown_words = []

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.