Skip to content

Instantly share code, notes, and snippets.

View adimyth's full-sized avatar
🎯
Focusing

Aditya Mishra adimyth

🎯
Focusing
View GitHub Profile
@adimyth
adimyth / data_provider.py
Last active November 9, 2020 18:04
OCR Attention - TF 2.3 compatible files
# Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
lstm = model.layers[2]
# Get output from intermediate layer to visualize activations
attn_func = K.function(inputs = [model.get_input_at(0), K.learning_phase()],
outputs = [lstm.output]
)