Return the unordered set of all layers.
Lookup a LayerSpec object by ID.
Lookup a LayerSpec object by name.
Specifier for the source of the image data. This may be None if the data was generated programatically, or an InputSource object if the data came from an image file.
Specifier for the raw input data.
Specifier for the result of S1 filtering.
Specifier for the result of C1 pooling.
Specifier for the result of S2 filtering.
Specifier for the result of C2 (local) pooling.
Specifier for the result of IT (global) pooling.
A dictionary container for the Model state.
The main purpose of extending the dictionary (instead of just storing states as dictionary objects) is to indicate with which model a given state is associated. Similarly, each model has a seperate state object, so it is always clear which model generated a given state object.
Bases: glimpse.models.viz2.ops.ModelOps, glimpse.models.misc.AbstractNetwork
Create a 2-part, HMAX-like hierarchy of S+C layers.
This module implements the “Viz2” model used for the GCNC 2011 experiments.
Compute the C1 layer activity from multi-scale S1 activity.
| Parameters: | s1s (4D ndarray of float) – S1 activity for each scale. |
|---|---|
| Returns: | C1 activity, with one array per scale. |
| Return type: | list of 3D ndarray of float |
Compute the C2 layer activity from multi-scale S2 activity.
| Parameters: | s2s – S2 activity |
|---|---|
| Type : | s2s: 4D array |
| Returns: | C2 activity for each scale and prototype |
| Return type: | 2D ndarray of float |
Create the initial image layer from some input.
| Parameters: | input (PIL.Image or 2D ndarray) – Input data. If array, values should lie in the range [0, 1]. |
|---|---|
| Returns: | image layer data |
| Return type: | 2D ndarray of float |
Compute the IT layer activity from multi-scale C2 activity.
| Parameters: | c2s (2D ndarray of float) – C2 activity |
|---|---|
| Returns: | IT activity for each prototype |
| Return type: | 1D ndarray of float |
Apply the model through to the given layer.
| Parameters: |
|
|---|---|
| Returns: | Output state containing the given layer |
| Return type: |
Create a function that will apply the model through to the given layer.
| Parameters: |
|
|---|---|
| Returns: | A callable object that, when evaluated, will apply the model. |
| Return type: |
Construct the given output value.
The output value is built by recursively building required dependencies. A node is considered to be built if the node’s key is set in the state dictionary, even if the corresponding value is None.
| Parameters: |
|
|---|---|
| Returns: | The final state of the network, which is guaranteed to contain a value for the output node. |
| Return type: | dict |
Compute retinal layer activity from the input image.
| Parameters: | img – Image data |
|---|---|
| Type : | 2D ndarray of float |
| Return type: | 2D ndarray of float |
Apply S1 processing to some existing retinal layer data.
Note
This method pools over phase, so the output array has only scale and orientation bands.
| Parameters: | retina (2D ndarray of float) – Result of retinal layer processing. |
|---|---|
| Return type: | 4D ndarray of float |
Compute the S2 layer activity from multi-scale C1 activity.
| Parameters: | c1s (4D ndarray of float, or list of 3D ndarray of float) – C1 activity |
|---|---|
| Returns: | S2 activity for each scale |
| Return type: | 4D ndarray of float |
Compute activity for a single model layer.
This method is called by BuildNode().
| Parameters: |
|
|---|---|
| Returns: | Activity for given output layer. |
| Return type: | ndarray |
Find the set of dependencies for a given model layer.
| Return type: | list of LayerSpec |
|---|
Imprint a set of S2 prototypes from a set of images.
| Parameters: |
|
|---|---|
| Returns: | A numpy array of prototypes, and a list of prototype locations. |
Create a model state with a single SOURCE layer.
| Parameters: |
|
|---|---|
| Returns: | The new model state. |
| Return type: |
Create a model state with a single IMAGE layer.
| Parameters: |
|
|---|---|
| Returns: | The new model state. |
| Return type: |
alias of Params
Compute C1 activity and sample patches from random locations and scales.
| Parameters: |
|
|---|---|
| Returns: | The set of patches |
| Return type: | list of (patch, location) pairs |
Create a function that will sample patches from random locations and scales.
| Parameters: |
|
|---|---|
| Returns: | A callable object that, when evaluated, will sample patches |
| Return type: |
The expected shape of the S1 kernels array, including band structure.
| Return type: | tuple of int |
|---|
The S1 kernels array, which are generated if not set.
The expected shape of a single S2 kernel, without band structure.
| Return type: | tuple of int |
|---|
The S2 kernels array.
Represents a serializable function.
This function computes a network state transformation, computing the value of some network layer and any required dependencies.
Transform between network states.
Create a new object.
| Parameters: |
|
|---|
Represents a serializable function.
This function computes a network state transformation for feedforward S->C layer networks. This function computes C1 activity and then extracts patches from randomly-sampled locations and scales.