Skip to content

Instantly share code, notes, and snippets.

View hailiang-wang's full-sized avatar
🌴
On vacation

Hai Liang W. hailiang-wang

🌴
On vacation
View GitHub Profile
@hailiang-wang
hailiang-wang / Install NVIDIA Driver and CUDA.md
Created June 21, 2019 03:24 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@hailiang-wang
hailiang-wang / ltp_parser.py
Last active April 13, 2018 06:27
HIT LTP Parser
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#===============================================================================
#
# Copyright (c) 2017 <> All Rights Reserved
#
#
# File: /Users/hain/tmp/ltp_parser.py
# Author: Hai Liang Wang
# Date: 2018-04-12:18:49:38
layout title excerpt category tags disqus
post
深度学习:调节网络超参数
在训练前,需要先规划超级参数,比如batch size, etc.
development
deeplearning
true

使用神经网络完成分类,物体识别,序列化标注,问答,生成式对话、翻译、摘要已成为标准手段,在训练神经网络时,一个很难的地方是怎么调试网络的超参数,超参数影响了网络的收敛速度,也影响最终的结果。

@hailiang-wang
hailiang-wang / gist:2c935182fb7213205284f7cd5040536a
Created February 22, 2018 03:49 — forked from syllog1sm/gist:10343947
A simple Python dependency parser
"""A simple implementation of a greedy transition-based parser. Released under BSD license."""
from os import path
import os
import sys
from collections import defaultdict
import random
import time
import pickle
SHIFT = 0; RIGHT = 1; LEFT = 2;
@hailiang-wang
hailiang-wang / clusterdump.sh
Created October 24, 2017 10:10 — forked from zviri/clusterdump.sh
Mahout cheat-sheet
mahout clusterdump \
-dt sequencefile \ # format: {Integer => String}
-d reuters-vectors/dictionary.file-* \ # dictionary: {id => word}
-i reuters-kmeans-clusters/clusters-3-final \ # input
-o clusters.txt \ # output (local filesystem)
-b 10 \ # format length
-n 10 # number of top terms to print
--distanceMeasure org.apache.mahout.common.distance.CosineDistanceMeasure # default is euclidean distance
@hailiang-wang
hailiang-wang / pom.xml
Created October 23, 2017 11:54 — forked from daniel-perry/pom.xml
This mahout example: https://cwiki.apache.org/confluence/display/MAHOUT/Quick+tour+of+text+analysis+using+the+Mahout+command+line assumes you know how to use maven to run apache lucene on some text.. which I didn't. This gist is a pom.xml file that will allow you to run the indicated maven command on the reuters text dataset, cobbled together fr…
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dataproj.maven</groupId>
<artifactId>running-lucene-with-maven</artifactId>
<packaging>war</packaging>
<version>0.1</version>
<profiles>
<!-- Add profile configuration here -->
</profiles>
@hailiang-wang
hailiang-wang / gist:497cc491989046309ced8467b4a31df4
Created July 26, 2017 09:11 — forked from carlosmcevilly/gist:2221249
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
@hailiang-wang
hailiang-wang / mmseg_example.py
Created July 19, 2017 18:16
基于MMSEG中文分词算法的 Python3 实现
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#===============================================================================
#
# Copyright 2017 Hai Liang Wang <hailiang.hl.wang@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@hailiang-wang
hailiang-wang / viterbi_example.py
Last active June 27, 2017 14:39
维特比算法
# -*- coding: utf-8 -*-
# Python3
# 维特比算法
# demo code of https://zh.wikipedia.org/wiki/%E7%BB%B4%E7%89%B9%E6%AF%94%E7%AE%97%E6%B3%95
states = ('Healthy', 'Fever')
observations = ('normal', 'cold', 'dizzy')
start_probability = {'Healthy': 0.6, 'Fever': 0.4}
@hailiang-wang
hailiang-wang / gist:c7f16239c55f25656c1059a7baf16b33
Created June 24, 2017 06:26 — forked from ttezel/gist:4138642
Natural Language Processing Notes

#A Collection of NLP notes

##N-grams

###Calculating unigram probabilities:

P( wi ) = count ( wi ) ) / count ( total number of words )

In english..