-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from customprogrammingsolutions/refactor-model
[MRG] Clean up Model
- Loading branch information
Showing
13 changed files
with
383 additions
and
196 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Base tensorflow exception class | ||
# implemented here: https://github.com/tensorflow/tensorflow/blob/28340a4b12e286fe14bb7ac08aebe325c3e150b4/tensorflow/python/framework/errors_impl.py#L32 | ||
class OpError(Exception): ... | ||
|
||
|
||
class ResourceExhaustedError(OpError): ... | ||
|
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,29 @@ | ||
from typing import Any, Optional, Tuple | ||
|
||
# ctc_beam_search_decoder implemented here: | ||
# https://github.com/tensorflow/tensorflow/blob/bb4e724f429ae5c9afad3a343dc1f483ecde1f74/tensorflow/python/ops/ctc_ops.py#L234 | ||
def ctc_beam_search_decoder(inputs : Any , sequence_length: Any, beam_width: int =100, | ||
top_paths: int = 1, merge_repeated: bool = True) -> Tuple[Any, Any]: ... | ||
|
||
# bidirectional_dynamic_rnn implemented here: | ||
# https://github.com/tensorflow/tensorflow/blob/d8f9538ab48e3c677aaf532769d29bc29a05b76e/tensorflow/python/ops/rnn.py#L314 | ||
# TODO: types | ||
# scope VariableScope | ||
def bidirectional_dynamic_rnn(cell_fw: Any, cell_bw: Any, inputs: Any, sequence_length: Any = None, | ||
initial_state_fw: Any = None, initial_state_bw: Any = None, | ||
dtype: Any = None, parallel_iterations: Optional[int] = None, | ||
swap_memory: Optional[bool]=False, time_major:Optional[bool]=False, scope: Any=None) -> Tuple[Any, Any]: ... | ||
|
||
# ctc_loss implemented here: | ||
# https://github.com/tensorflow/tensorflow/blob/bb4e724f429ae5c9afad3a343dc1f483ecde1f74/tensorflow/python/ops/ctc_ops.py#L32 | ||
# TODO: types | ||
def ctc_loss(labels: Any, inputs: Any, sequence_length: Any, | ||
preprocess_collapse_repeated: bool=False, | ||
ctc_merge_repeated: bool=True, ignore_longer_outputs_than_inputs: bool=False, | ||
time_major: bool=True) -> Any: ... | ||
|
||
# log_softmax implemented here: | ||
# https://github.com/tensorflow/tensorflow/blob/95c8f92947c6a420b70759d9d0d7825f2f5de368/tensorflow/python/ops/nn_ops.py#L1741 | ||
# TODO: types | ||
# Returns Tensor | ||
def log_softmax(logits: Any, axis: Optional[int] = None, name: Optional[str]=None, dim: Optional[int]=None) -> Any: ... |
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,8 +1,17 @@ | ||
from typing import Any | ||
from typing import Any, Optional | ||
|
||
def import_meta_graph(path: str) -> Any: | ||
pass | ||
|
||
# Saver class defined here | ||
# https://github.com/tensorflow/tensorflow/blob/28340a4b12e286fe14bb7ac08aebe325c3e150b4/tensorflow/python/training/saver.py#L1075 | ||
class Saver: | ||
def restore(self, session: Any, path: str) -> None: | ||
pass | ||
|
||
# TODO: parameter types: | ||
# sess is of type Session | ||
# global_step is of type Tensor or integer | ||
def save(self, sess: Any, save_path: str, global_step: Any = None, latest_filename: Optional[str]=None, | ||
meta_graph_suffix: str = "meta", write_meta_graph: bool = True, write_state: bool = True, | ||
strip_default_attrs: bool = False) -> Optional[str]: ... |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
tox | ||
pylint>1.8 | ||
pytest | ||
mypy>=0.6 |