neon.layers.layer.Affine

class neon.layers.layer.Affine(nout, init, bias=None, batch_norm=False, activation=None, name=None, parallelism='Disabled')[source]

Bases: neon.layers.layer.CompoundLayer

A linear layer with a learned bias and activation, implemented as a list composing separate linear, bias/batchnorm and activation layers.

Parameters:
  • nout (int, tuple) – Desired size or shape of layer output
  • init (Initializer, optional) – Initializer object to use for initializing layer weights
  • bias (Initializer) – an initializer to use for bias parameters
  • activation (Transform) – a transform object with fprop and bprop functions to apply
  • name (str) – the root name for the layer, suffixes are automatically generated for the component layers
__init__(nout, init, bias=None, batch_norm=False, activation=None, name=None, parallelism='Disabled')[source]

Methods

__init__(nout, init[, bias, batch_norm, …])
add_postfilter_layers()
append((object) -> None – append object to end)
clear(() -> None – remove all items from L)
copy(() -> list – a shallow copy of L)
count(…)
extend(…)
index((value, [start, …) Raises ValueError if the value is not present.
init_base_name()
insert L.insert(index, object) – insert object before index
pop(…) Raises IndexError if list is empty or index is out of range.
remove(…) Raises ValueError if the value is not present.
reverse L.reverse() – reverse IN PLACE
sort((key=None[, reverse])
add_postfilter_layers()
append(object) → None -- append object to end
clear() → None -- remove all items from L
copy() → list -- a shallow copy of L
count(value) → integer -- return number of occurrences of value
extend(iterable) → None -- extend list by appending elements from the iterable
index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

init_base_name()
insert()

L.insert(index, object) – insert object before index

pop([index]) → item -- remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

remove(value) → None -- remove first occurrence of value.

Raises ValueError if the value is not present.

reverse()

L.reverse() – reverse IN PLACE

sort(key=None, reverse=False) → None -- stable sort *IN PLACE*