neon.data.ticker.PrioritySortTask

class neon.data.ticker.PrioritySortTask(seq_len_max, vec_size)[source]

Bases: neon.data.ticker.Task

Priority Sort task from the Neural Turing Machines paper:
http://arxiv.org/abs/1410.5401.

See also

See comments on CopyTask class for more details.

__init__(seq_len_max, vec_size)[source]

Set up the attributes that ticker needs to see.

Parameters:
  • seq_len_max (int) – Longest allowable sequence length
  • vec_size (int) – Width of the bit-vector to be copied (this was 8 in paper)

Methods

__init__(seq_len_max, vec_size) Set up the attributes that ticker needs to see.
fetch_io(time_steps) Generate inputs, outputs numpy tensor pair of size appropriate for this minibatch.
fill_buffers(time_steps, inputs, outputs, …) Prepare data for delivery to device.
gen_class(pdict)
get_description([skip]) Returns a dict that contains all necessary information needed to serialize this object.
recursive_gen(pdict, key) helper method to check whether the definition
synthesize(in_tensor, out_tensor, mask) Create a new minibatch of ticker priority sort task data.
be = None
classnm

Returns the class name.

fetch_io(time_steps)

Generate inputs, outputs numpy tensor pair of size appropriate for this minibatch.

Parameters:time_steps (int) – Number of time steps in this minibatch.
Returns:(input, output) tuple of numpy arrays.
Return type:tuple
fill_buffers(time_steps, inputs, outputs, in_tensor, out_tensor, mask)

Prepare data for delivery to device.

Parameters:
  • time_steps (int) – Number of time steps in this minibatch.
  • inputs (numpy array) – Inputs numpy array
  • outputs (numpy array) – Outputs numpy array
  • in_tensor (Tensor) – Device buffer holding inputs
  • out_tensor (Tensor) – Device buffer holding outputs
  • mask (numpy array) – Device buffer for the output mask
gen_class(pdict)
get_description(skip=[], **kwargs)

Returns a dict that contains all necessary information needed to serialize this object.

Parameters:skip (list) – Objects to omit from the dictionary.
Returns:Dictionary format for object information.
Return type:(dict)
modulenm

Returns the full module path.

recursive_gen(pdict, key)

helper method to check whether the definition dictionary is defining a NervanaObject child, if so it will instantiate that object and replace the dictionary element with an instance of that object

synthesize(in_tensor, out_tensor, mask)[source]

Create a new minibatch of ticker priority sort task data.

Parameters:
  • in_tensor – device buffer holding inputs
  • out_tensor – device buffer holding outputs
  • mask – device buffer for the output mask