Skip to Main Content
Machine Learning for Finance
book

Machine Learning for Finance

by James Le, Jannes Klaas
May 2019
Intermediate to advanced content levelIntermediate to advanced
456 pages
11h 38m
English
Packt Publishing
Content preview from Machine Learning for Finance

Attention

Are you paying attention? If so, certainly not to everyone equally. In any text, some words matter more than others. An attention mechanism is a way for a neural network to focus on a certain element in a sequence. Focusing, for neural networks, means amplifying what is important:

Attention

An example of an attention mechanism

Attention layers are fully connected layers that take in a sequence and output the weighting for a sequence. The sequence is then multiplied with the weightings:

def attention_3d_block(inputs,time_steps,single_attention_vector = False): input_dim = int(inputs.shape[2]) #1 a = Permute((2, 1),name='Attent_Permute')(inputs) #2 a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning for Finance

Machine Learning for Finance

Aryan Singh

Publisher Resources

ISBN: 9781789136364Supplemental Content