Skip to content

Commit 21ffd5e

Browse files
committed
update
1 parent ad93ee7 commit 21ffd5e

File tree

65 files changed

+4467
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+4467
-157
lines changed

.gitignore

Lines changed: 106 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,108 @@
1-
.DS_Store
2-
*.DS_Store
1+
# Byte-compiled / optimized / DLL files
32
__pycache__/
4-
*/__pycache__/
5-
*__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# Environments
85+
.env
86+
.venv
87+
env/
88+
venv/
89+
ENV/
90+
env.bak/
91+
venv.bak/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/
105+
106+
# custom
6107
.idea/
7-
*/.idea/
8-
*.idea/
108+

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Amusing Python Codes
22

3-
![Authour](https://img.shields.io/badge/Author-Zhang%20Hao%20(Isaac%20Changhau)-blue.svg)
3+
![Author](https://img.shields.io/badge/Author-Zhang%20Hao%20(Isaac%20Changhau)-blue.svg)
44

55
Interesting python codes to deal with some simple and practical tasks.
66

@@ -24,4 +24,5 @@ Interesting python codes to deal with some simple and practical tasks.
2424
- [**Stanford CoreNLP Demo**](/stanford_corenlp_demo)
2525
- [**Stock Prices Predict**](/stock_prices_predict)
2626
- [**TransX · Embedding Entities and Relationships of Multi-relational Data**](/transx)
27-
- [**WeChat Exploration using itchat Package**](/wechat_exploration)
27+
- [**WeChat Exploration using itchat Package**](/wechat_exploration)
28+
- [**Text Classification via Traditional Machine Learning Methods (sklearn-based)**](/text_classification_in_ml)

basic_word2vec_example/word2vec_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import numpy as np
33
import tensorflow as tf
44
import os
5-
from data_utils import maybe_download, read_data, build_dataset, tsne_and_plot, generate_batch
5+
from .data_utils import maybe_download, read_data, build_dataset, tsne_and_plot, generate_batch
66

77
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # suppress tensorflow warnings
88

batch_normalization/batch_norm_cnn_example_1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import tensorflow as tf
33

44
from tensorflow.examples.tutorials.mnist import input_data
5-
from nn_functions import multiclass_log_loss
6-
from cnn_model import batch_norm_cnn
5+
from .nn_functions import multiclass_log_loss
6+
from .cnn_model import batch_norm_cnn
77

88
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # suppress tensorflow warnings
99

batch_normalization/batch_norm_cnn_example_2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import tensorflow as tf
33

44
from tensorflow.examples.tutorials.mnist import input_data
5-
from nn_functions import multiclass_log_loss
6-
from cnn_model import batch_norm_cnn
5+
from .nn_functions import multiclass_log_loss
6+
from .cnn_model import batch_norm_cnn
77

88
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # suppress tensorflow warnings
99

batch_normalization/cnn_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import tensorflow as tf
2-
from nn_layers import Conv2dLayer, MaxPooling2dLayer, DenseLayer, SoftmaxLayer
3-
from nn_functions import batch_normalization
2+
from .nn_layers import Conv2dLayer, MaxPooling2dLayer, DenseLayer, SoftmaxLayer
3+
from .nn_functions import batch_normalization
44

55

66
def batch_norm_cnn(x, y_, keep_prob, phase_train):

dmn/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python3
22
import os
33
import tensorflow as tf
4-
from read_data import read_babi, get_max_sizes
5-
from utils.data_utils import load_glove, WordTable
4+
from .read_data import read_babi, get_max_sizes
5+
from .utils.data_utils import load_glove, WordTable
66

77
flags = tf.flags
88

dmn/models/new/dmn_plus.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import tensorflow as tf
33
from tensorflow.python.ops import rnn_cell
44

5-
from models.base_model import BaseModel
6-
from models.new.episode_module import EpisodeModule
7-
from utils.nn import weight, bias, dropout, batch_norm
5+
from ..base_model import BaseModel
6+
from .episode_module import EpisodeModule
7+
from ...utils.nn import weight, bias, dropout, batch_norm
88

99

1010
class DMN(BaseModel):

dmn/models/new/episode_module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import tensorflow as tf
22

3-
from utils.nn import weight, bias
4-
from utils.attn_gru import AttnGRU
3+
from ...utils.nn import weight, bias
4+
from ...utils.attn_gru import AttnGRU
55

66

77
class EpisodeModule:

dmn/models/old/dmn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from tensorflow.python.ops import rnn_cell
44
from tensorflow.contrib.legacy_seq2seq.python.ops import seq2seq
55

6-
from models.base_model import BaseModel
7-
from models.old.episode_module import EpisodeModule
8-
from utils.nn import weight, batch_norm, dropout
6+
from ..base_model import BaseModel
7+
from .episode_module import EpisodeModule
8+
from ...utils.nn import weight, batch_norm, dropout
99

1010

1111
class DMN(BaseModel):

0 commit comments

Comments
 (0)