Skip to content

Bhargavoza1/cuda_neural_network

Repository files navigation

Neural networks from scratch in CUDA C++

In this project, I tried to make performance similar to PyTorch. but there is still a long way to go.
I was using rtx 4070ti gpu in my local computer.

Algo that I have written in this project.

Layers

  • BatchNorm
  • CNN2D
  • flatten_layer
  • linear
  • MaxPool2d
  • ReLU
  • Sigmoid

costs

  • MSE(mean squared error)

Models

  • MLP(multilayer perceptron)
  • Image_CF(image classification). Used opencv lib for image processing.

Image classification Model architecture

How to run this?

For windows

I have used Visual Studio 2019.
MSVC = 14.29.30133 (v142)
CUDA = v12.2

After installing all those tools. It will run without any problem.

For Linux

Copy linux_cuda_nn to your any dir.

cd linux_cuda_nn
mkdir build
cd build
cmake ..
make
./cuda_nn