Skip to content

fcnn

Module: fcnn.py

This module implements Fully Connected Neural Networks

It provides functionality to
  • Train Fully Connected Neural Networks

Classes:

Name Description
FCNN

Implements a Fully Connected Neural Network building up on base.py.

Key Features
  • Built on top of base class getting all its functionalities
  • Efficient neural networks implementation using equinox modules
Authors
  • Lokesh Mohanty (lokeshm@iisc.ac.in)
Version Info
  • 03/01/2025: Initial version

FCNN

Bases: Network

Source code in scirex/core/dl/fcnn.py
class FCNN(Network):
    layers: list

    """
    Fully Connected Neural Network
    """

    def __init__(self, layers: list):
        """
        Constructor for Fully Connected Neural Network

        Args:
            layers: List of layers
        """
        self.layers = layers

    def __call__(self, x: jnp.ndarray):
        """
        Forward pass of the Fully Connected Neural Network
        Args:
            x: Input tensor

        Returns:
            jnp.ndarray: Output tensor
        """
        for layer in self.layers:
            x = layer(x)
        return x

layers = layers instance-attribute

Fully Connected Neural Network

__call__(x)

Forward pass of the Fully Connected Neural Network Args: x: Input tensor

Returns:

Type Description

jnp.ndarray: Output tensor

Source code in scirex/core/dl/fcnn.py
def __call__(self, x: jnp.ndarray):
    """
    Forward pass of the Fully Connected Neural Network
    Args:
        x: Input tensor

    Returns:
        jnp.ndarray: Output tensor
    """
    for layer in self.layers:
        x = layer(x)
    return x

__init__(layers)

Constructor for Fully Connected Neural Network

Parameters:

Name Type Description Default
layers list

List of layers

required
Source code in scirex/core/dl/fcnn.py
def __init__(self, layers: list):
    """
    Constructor for Fully Connected Neural Network

    Args:
        layers: List of layers
    """
    self.layers = layers