Skip to content

Instantly share code, notes, and snippets.

View liuyijiang1994's full-sized avatar
💭
ppter

peco liuyijiang1994

💭
ppter
View GitHub Profile
from ekphrasis.classes.preprocessor import TextPreProcessor
from ekphrasis.classes.tokenizer import SocialTokenizer
from ekphrasis.dicts.emoticons import emoticons
import numpy as np
import re
import io
label2emotion = {0: "others", 1: "happy", 2: "sad", 3: "angry"}
emotion2label = {"others": 0, "happy": 1, "sad": 2, "angry": 3}
@jeasinema
jeasinema / weight_init.py
Last active May 25, 2023 09:32
A simple script for parameter initialization for PyTorch
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
def weight_init(m):
'''
@Coldmooon
Coldmooon / caffe_error_solutions.md
Last active June 10, 2017 19:09
Caffe 安装错误记录及解决办法

Caffe 安装错误记录及解决办法

以后在博客里更新: http://coldmooon.github.io/

1)Fatal error : 'tr1/tuple' file not found

出现该问题有两种情况,可以先尝试下面的链接: BVLC/caffe#1358 如果不行,那说明是 Makefile 文件除了问题。一般来说,按照 BVLC/caffe#1740