Receptive fields
ReceptiveFields
Bases: LoggingMixin
__init__(size, sectors=64, arrangement=RFArrangement.LogPolar, phyllotactic=False, ksize=None, kscale=None, kbounds=None, kangle=0.0, kshape=KernelShape.Elliptic, kfilter=KernelFilter.Uniform, kparams=None, substrate=None, name=None, notifier=None)
A set of receptive fields that can be used as the base for a layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
tuple[int, ...] | ndarray
|
The dimensions of the visual field (height, width, depth). NOTE: Colour vision is not implemented yet. It would be necessary to take into account the depth dimension. |
required |
sectors
|
int
|
Number of sectors ('wedges') for logpolar receptive fields. |
64
|
arrangement
|
RFArrangement | str
|
Defines how the RFs are arranged spatially to cover the visual field. |
LogPolar
|
phyllotactic
|
bool
|
Switch for phyllotactic arrangement of receptive fields. Only relevant for logpolar arrangement. |
False
|
ksize
|
int | tuple[int, ...] | ndarray
|
The kernel size. Only used for Cartesian arrangements at the moment. For logpolar arrangements, the kernel size is computed based on the distance from the fovea. |
None
|
kscale
|
tuple[int, ...] | ndarray | None
|
A scaling factor for kernels. A 2D value indicates that each dimension should be scaled independently. Larger values result in kernels that may overlap more, while smaller values may result in kernels that leave gaps in the visual field. |
None
|
kbounds
|
tuple[int, ...] | ndarray | None
|
Kernel size bounds. Can be specified in any of the following forms: - (min_x, min_y, max_x, max_y): Upper and lower bounds specified. - (min_x, min_y): Implicitly no upper bound. - (1, 1, max_x, max_y): No lower bound (beyond the trivial (1, 1)). |
None
|
kangle
|
float
|
Kernel rotation angle in degrees. Assumed to increase from 0 to 360 counterclockwise. |
0.0
|
kshape
|
KernelShape | str
|
The kernel shape. NOTE: This is not the same as a tensor shape. Rather, it is the geometric shape of the kernel (rectangular, elliptic, etc.). |
Elliptic
|
kfilter
|
KernelFilter | str
|
The filter response type for receptive fields in this layer. |
Uniform
|
kparams
|
dict[str, Any] | None
|
Extra parameters to pass to the kernel factory function. |
None
|
substrate
|
ndarray | None
|
The coordinates of the input cells that constitute the 'substrate' to which the receptive fields are applied. |
None
|
name
|
str | None
|
An optional name for this instance. |
None
|
notifier
|
Callable | None
|
A progress notification function. |
None
|
visualise(cells=None, cell_colour='#00ffffff', kernel_colour='#ffffffff', outline_colour='#ffff0077', weighted=False, title=None)
Visualise the cells and their receptive fields.
TODO: This is a temporary workaround until excitatory / inhibitory substrates are moved into the ReceptiveFields class so that they don't have to be passed as arguments to self.visualise().
Args:
cells: Coordinates of the cells to plot.
cell_colour: The colour to use for highlighting the plotted cells.
kernel_colour: The colour to use for highlighting the plotted receptive field.
outline_colour: The colour to use for drawing the kernel outlines.
weighted: If set, use the kernel weights, otherwise use a uniform value.
Returns:
| Type | Description |
|---|---|
figure
|
A visualisation of the receptive fields. |