Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Commit e316a33

Browse files
committed
Initial commit
0 parents  commit e316a33

19 files changed

+365
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: CyberZHG
7+
8+
---
9+
10+
**Describe the Bug**
11+
12+
A clear and concise description of what the bug is.
13+
14+
**Version Info**
15+
16+
* The version I used is: <0.0.0>
17+
18+
**Minimal Codes To Reproduce**
19+
20+
```python
21+
import keras_xxx
22+
23+
pass
24+
```
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: CyberZHG
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/question.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Question
3+
about: Ask questions about the repo
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
8+
---
9+
10+

.github/stale.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
daysUntilStale: 5
2+
daysUntilClose: 2

.gitignore

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Byte-compiled / optimized / DLL files
2+
__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+
# System thumbnail
107+
.DS_Store
108+
109+
# IDE
110+
.idea
111+
112+
# Images
113+
*.png
114+
115+
# Models
116+
*.h5

.travis.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
dist: xenial
2+
language: python
3+
python:
4+
- 3.6
5+
env:
6+
- KERAS_BACKEND=tensorflow TF_KERAS=1 TF_2=1
7+
- KERAS_BACKEND=tensorflow TF_KERAS=1 TF_EAGER=1
8+
- KERAS_BACKEND=tensorflow TF_KERAS=1
9+
- KERAS_BACKEND=tensorflow
10+
# - KERAS_BACKEND=theano THEANO_FLAGS=optimizer=fast_compile
11+
install:
12+
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
13+
- bash miniconda.sh -b -p $HOME/miniconda
14+
- export PATH="$HOME/miniconda/bin:$PATH"
15+
- conda config --set always_yes yes --set changeps1 no
16+
- conda update -q conda
17+
- conda info -a
18+
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
19+
- source activate test-environment
20+
- export LD_LIBRARY_PATH=$HOME/miniconda/envs/test-environment/lib/:$LD_LIBRARY_PATH
21+
- pip install --upgrade pip
22+
- pip install -r requirements.txt
23+
- pip install -r requirements-dev.txt
24+
- if [[ $TF_2 == "1" ]]; then pip install tensorflow==2.0.0-beta1; fi
25+
- if [[ $KERAS_BACKEND == "theano" ]]; then pip install theano && conda install mkl mkl-service; fi
26+
- pip install coveralls
27+
script:
28+
- ./test.sh
29+
after_success:
30+
coveralls

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## [Unreleased]
4+
5+
## [0.0.0] - 2077-07-07
6+
7+
### Added

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Zhao HG
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include README.md
2+
include README-zh-CN.md
3+
include CHANGELOG.md
4+
include requirements.txt

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Keras XXX
2+
3+
[![Travis](https://travis-ci.org/CyberZHG/keras-xxx.svg)](https://travis-ci.org/CyberZHG/keras-xxx)
4+
[![Coverage](https://coveralls.io/repos/github/CyberZHG/keras-xxx/badge.svg?branch=master)](https://coveralls.io/github/CyberZHG/keras-xxx)
5+
[![Version](https://img.shields.io/pypi/v/keras-xxx.svg)](https://pypi.org/project/keras-xxx/)
6+
![Downloads](https://img.shields.io/pypi/dm/keras-xxx.svg)
7+
![License](https://img.shields.io/pypi/l/keras-xxx.svg)
8+
9+
![](https://img.shields.io/badge/keras-tensorflow-blue.svg)
10+
![](https://img.shields.io/badge/keras-theano-blue.svg)
11+
![](https://img.shields.io/badge/keras-tf.keras-blue.svg)
12+
![](https://img.shields.io/badge/keras-tf.keras/eager-blue.svg)
13+
![](https://img.shields.io/badge/keras-tf.keras/2.0_beta-blue.svg)
14+
15+
\[[中文](https://github.com/CyberZHG/keras-xxx/blob/master/README.zh-CN.md)|[English](https://github.com/CyberZHG/keras-xxx/blob/master/README.md)\]
16+
17+
## Install
18+
19+
```bash
20+
pip install keras-xxx
21+
```
22+
23+
## Usage

README.zh-CN.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Keras XXX
2+
3+
[![Travis](https://travis-ci.org/CyberZHG/keras-xxx.svg)](https://travis-ci.org/CyberZHG/keras-xxx)
4+
[![Coverage](https://coveralls.io/repos/github/CyberZHG/keras-xxx/badge.svg?branch=master)](https://coveralls.io/github/CyberZHG/keras-xxx)
5+
[![Version](https://img.shields.io/pypi/v/keras-xxx.svg)](https://pypi.org/project/keras-xxx/)
6+
![Downloads](https://img.shields.io/pypi/dm/keras-xxx.svg)
7+
![License](https://img.shields.io/pypi/l/keras-xxx.svg)
8+
9+
![](https://img.shields.io/badge/keras-tensorflow-blue.svg)
10+
![](https://img.shields.io/badge/keras-theano-blue.svg)
11+
![](https://img.shields.io/badge/keras-tf.keras-blue.svg)
12+
![](https://img.shields.io/badge/keras-tf.keras/eager-blue.svg)
13+
![](https://img.shields.io/badge/keras-tf.keras/2.0_beta-blue.svg)
14+
15+
\[[中文](https://github.com/CyberZHG/keras-xxx/blob/master/README.zh-CN.md)|[English](https://github.com/CyberZHG/keras-xxx/blob/master/README.md)\]
16+
17+
## 安装
18+
19+
```bash
20+
pip install keras-xxx
21+
```
22+
23+
## 使用

keras_xxx/__init__.py

Whitespace-only changes.

keras_xxx/backend.py

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import os
2+
3+
__all__ = [
4+
'keras', 'utils', 'activations', 'applications', 'backend', 'datasets', 'engine',
5+
'layers', 'preprocessing', 'wrappers', 'callbacks', 'constraints', 'initializers',
6+
'metrics', 'models', 'losses', 'optimizers', 'regularizers', 'TF_KERAS', 'EAGER_MODE'
7+
]
8+
9+
TF_KERAS = False
10+
EAGER_MODE = False
11+
12+
if os.environ.get('TF_KERAS', '0') != '0':
13+
import tensorflow as tf
14+
from tensorflow.python import keras
15+
TF_KERAS = True
16+
if os.environ.get('TF_EAGER', '0') != '0':
17+
try:
18+
tf.enable_eager_execution()
19+
raise AttributeError()
20+
except AttributeError as e:
21+
pass
22+
EAGER_MODE = tf.executing_eagerly()
23+
else:
24+
import keras
25+
26+
utils = keras.utils
27+
activations = keras.activations
28+
applications = keras.applications
29+
backend = keras.backend
30+
datasets = keras.datasets
31+
engine = keras.engine
32+
layers = keras.layers
33+
preprocessing = keras.preprocessing
34+
wrappers = keras.wrappers
35+
callbacks = keras.callbacks
36+
constraints = keras.constraints
37+
initializers = keras.initializers
38+
metrics = keras.metrics
39+
models = keras.models
40+
losses = keras.losses
41+
optimizers = keras.optimizers
42+
regularizers = keras.regularizers

publish.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
rm -rf dist/* && python3 setup.py sdist && twine upload dist/*

requirements-dev.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
setuptools>=38.6.0
2+
twine>=1.11.0
3+
wheel>=0.31.0
4+
tensorflow
5+
nose
6+
pycodestyle
7+
coverage

requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
numpy
2+
Keras

setup.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import codecs
2+
from setuptools import setup, find_packages
3+
4+
with codecs.open('README.md', 'r', 'utf8') as reader:
5+
long_description = reader.read()
6+
7+
8+
with codecs.open('requirements.txt', 'r', 'utf8') as reader:
9+
install_requires = list(map(lambda x: x.strip(), reader.readlines()))
10+
11+
12+
setup(
13+
name='keras-xxx',
14+
version='0.0.0',
15+
packages=find_packages(),
16+
url='https://github.com/CyberZHG/keras-xxx',
17+
license='MIT',
18+
author='CyberZHG',
19+
author_email='[email protected]',
20+
description='XXX implemented in Keras',
21+
long_description=long_description,
22+
long_description_content_type='text/markdown',
23+
install_requires=install_requires,
24+
classifiers=(
25+
"Programming Language :: Python :: 3.6",
26+
"License :: OSI Approved :: MIT License",
27+
"Operating System :: OS Independent",
28+
),
29+
)

test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
pycodestyle --max-line-length=120 keras_xxx tests && \
3+
nosetests --nocapture --with-coverage --cover-erase --cover-html --cover-html-dir=htmlcov --cover-package=keras_xxx --with-doctest

tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)