This file contains hidden or 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
class AttentionWithContext(Layer): | |
""" | |
Attention operation, with a context/query vector, for temporal data. | |
Supports Masking. | |
Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf] | |
"Hierarchical Attention Networks for Document Classification" | |
by using a context vector to assist the attention | |
# Input shape | |
3D tensor with shape: `(samples, steps, features)`. | |
# Output shape |
This file contains hidden or 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
#include <QGuiApplication> | |
#include <QQmlApplicationEngine> | |
#include <QQmlComponent> | |
#include <QDebug> | |
#include <QQmlProperty> | |
#include <QQuickView> | |
//class MyClass : public QObject | |
//{ | |
// Q_OBJECT |
This file contains hidden or 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
board = [["o", "a", "g", "r"], ["s", "q", "n", "t"], ["e", "i", "s", "g"]] | |
def spell_all_words(board, word_dictionary): | |
words_found = list() | |
for row_number in range(len(board)): | |
for col_number in range(len(board[row_number])): | |
for i_offset in range(-1, 2): # get our adjacent characters | |
if not 0 <= row_number + i_offset < len(board): | |
continue |
This file contains hidden or 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
https://gist.github.com/abali96/438adb50415384149911 |
This file contains hidden or 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
if operands.each {|operand| operand[0] == "-"} | |
x = operands.shift | |
puts operands | |
pre_arguments = '"' + operands.join('", "').gsub(/-/, '') + '"' | |
add(x, pre_arguments) | |
end | |
# the add method accepts arguments as strings like add("1", "2", "3") |