Skip to content

Vectorize Neural network model #26

@willayy

Description

@willayy

If the neural network model is represented as a set or list of vector objects that contain activation functions, a weight tensor (multi dimensional matrix) that would make the model more configurable (make it possible to have different hidden layer structures) and make computation easier as it can be implemented with fast vector based math functions.

This can probably be done with NumPy arrays making it possible to use NumPy for computations.

Pseudo code example

class Layer
  z_val: Vector[float]
  a_val: Vector[float]
  activation_func: Function
  activation_func_derivative: Function
  weights: Matrix[float]

class Model
  layers: List[Layer]
  cost_function: Function
  cost_function_derivative: Function
  regularizaton_function: Function
  regularizaton_function_derivative: Function

Steps

  • Remake neuralNetworkStructs.h into neuralNetworkComponents.h, have it include the typedef (or struct) nd_vector which is a n-dimensional vector implementation and also make the new Layer struct.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions