New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TFModel improvements #475
TFModel improvements #475
Conversation
Codecov Report
@@ Coverage Diff @@
## master #475 +/- ##
=========================================
Coverage ? 40.75%
=========================================
Files ? 139
Lines ? 14024
Branches ? 0
=========================================
Hits ? 5715
Misses ? 8309
Partials ? 0
Continue to review full report at Codecov.
|
get_indices = np.vectorize(lambda c, arr=classes: np.where(c == arr)[0]) | ||
value = get_indices(value) | ||
classes = self.get_tensor_config(placeholder).get('classes') | ||
if not isinstance(classes, int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand it well but what if classes is int? Why can't be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, TFModel
is capable of working with custom class labels: [cats
, dogs
] for example. In this case, we need to manually transform such labels into int-classes, and this transform takes a lot of time. We don't need to do this in the case of integer
classes.
batch_size = get_batch_size(inputs, dynamic=True) | ||
shape = get_shape(inputs) | ||
ones = [1] * self.dim | ||
if self.insert: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably insert can be renamed to something related to add_last, add_first or something?
This PR proposes to:
Make
ConvBlock
able to chain multiple layers, just likeTorch
version canSimplify logic of letter parsing, as well as adding capability of using
R
letter as separateBranch
with complex parametersSwap all arguments inside calls to
conv_block
to keyword onesAdd
squeeze-and-excitation
versions ofResNet
Re-check all the tests of model compilation
Add various attention modules: some of them are available through
S
(stands for self-attention) letter, some of them are mods ofCombine