This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #55 Merge outputs as feature * Update README.md * Support tf.keras * Fix masked layer * Fix masked layer
- Loading branch information
Showing
24 changed files
with
104 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import os | ||
|
||
__all__ = [ | ||
'keras', 'utils', 'activations', 'applications', 'backend', 'datasets', 'engine', | ||
'layers', 'preprocessing', 'wrappers', 'callbacks', 'constraints', 'initializers', | ||
'metrics', 'models', 'losses', 'optimizers', 'regularizers', | ||
] | ||
|
||
if 'TF_KERAS' in os.environ and os.environ['TF_KERAS'] != '0': | ||
from tensorflow.python import keras | ||
from tensorflow.python.keras import utils | ||
from tensorflow.python.keras import activations | ||
from tensorflow.python.keras import applications | ||
from tensorflow.python.keras import backend | ||
from tensorflow.python.keras import datasets | ||
from tensorflow.python.keras import engine | ||
from tensorflow.python.keras import layers | ||
from tensorflow.python.keras import preprocessing | ||
from tensorflow.python.keras import wrappers | ||
from tensorflow.python.keras import callbacks | ||
from tensorflow.python.keras import constraints | ||
from tensorflow.python.keras import initializers | ||
from tensorflow.python.keras import metrics | ||
from tensorflow.python.keras import models | ||
from tensorflow.python.keras import losses | ||
from tensorflow.python.keras import optimizers | ||
from tensorflow.python.keras import regularizers | ||
else: | ||
import keras | ||
from keras import utils | ||
from keras import activations | ||
from keras import applications | ||
from keras import backend | ||
from keras import datasets | ||
from keras import engine | ||
from keras import layers | ||
from keras import preprocessing | ||
from keras import wrappers | ||
from keras import callbacks | ||
from keras import constraints | ||
from keras import initializers | ||
from keras import metrics | ||
from keras import models | ||
from keras import losses | ||
from keras import optimizers | ||
from keras import regularizers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import keras | ||
from keras_bert.backend import keras | ||
|
||
|
||
class Extract(keras.layers.Layer): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import keras | ||
from keras_bert.backend import keras | ||
|
||
|
||
def get_inputs(seq_len): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
numpy | ||
Keras | ||
keras-pos-embd==0.9.0 | ||
keras-transformer==0.21.0 | ||
keras-pos-embd==0.10.0 | ||
keras-transformer==0.22.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/usr/bin/env bash | ||
nosetests --with-coverage --cover-erase --cover-html --cover-html-dir=htmlcov --cover-package="keras_bert" tests | ||
pycodestyle --max-line-length=120 keras_bert tests && \ | ||
nosetests --with-coverage --cover-erase --cover-html --cover-html-dir=htmlcov --cover-package=keras_bert tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters