Skip to content

Sequential

Frank Seide edited this page Aug 16, 2016 · 18 revisions

Composes an array of functions into a new function that calls these functions one after another (forward function composition).

Sequential (arrayOfFunctions)

Parameters

arrayOfFunctions: a BrainScript array of functions, e.g. (LinearLayer{1024} : Sigmoid)

Return value

This function returns another function that takes one argument, and returns the result of applying all given functions in sequence to the input.

Description

Example

Standard 4-hidden layer feed-forward network as used in the earlier deep-neural network work on speech recognition:

model = Sequential (
    DenseLayer{2048, activation=Sigmoid} : 
    DenseLayer{2048, activation=Sigmoid} : 
    DenseLayer{2048, activation=Sigmoid} : 
    DenseLayer{2048, activation=Sigmoid} : 
    DenseLayer{9000, activation=Softmax}    # last is a Softmax 
)
Clone this wiki locally