Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fragNN

A C++/CUDA neural network trained on fragrance data to predict gender and main accord from perfume notes and accords.

Dataset

Download the dataset from Kaggle and place it in a datasets/ directory at the project root:

Dataset: Fragrantica Fragrance Dataset

fragNN/
└── datasets/
    └── fra_cleaned.csv

Run the preprocessing script before building:

cd datasets/
python3 ../preprocess.py

This will generate train.csv, test.csv, note_vocab.txt, and accord_vocab.txt inside data/.

Build

cmake -B .build
cmake --build .build

Or use the run script:

./run

Project Structure

fragNN/
├── data/                   # generated by preprocess.py — do not edit manually
├── datasets/               # place fra_cleaned.csv here
├── python/
│   ├── preprocess.py       # data preprocessing
│   ├── metrics.py          # WIP — ROC/precision visualization
│   └── post_nn_views.py    # WIP — results display
├── src/
│   ├── headers/
│   │   ├── dataloader.hpp
│   │   └── nn.hpp
│   ├── dataloader.cpp
│   └── nn.cpp
├── cuda/
│   ├── kernel.cuh           # master header — enum + includes all sub-headers
│   ├── headers/
│   │   ├── activations.cuh  # __device__ activation functions
│   │   ├── backprop.cuh     # backward pass kernels
│   │   ├── fwd.cuh          # forward pass kernels
│   │   ├── init.cuh         # initialization kernels
│   │   ├── loss.cuh         # __device__ loss functions
│   │   ├── metrics.cuh      # metrics structs + router
│   │   ├── nn.cuh           # NeuralNetwork class declaration
│   │   └── utils.cuh        # optimizer/utility kernels
│   ├── activations.cu
│   ├── backprop.cu
│   ├── fwd.cu
│   ├── init.cu
│   ├── loss.cu
│   ├── metrics.cu
│   ├── nn.cu
│   └── utils.cu
├── utils/
│   ├── embellish.cuh        # terminal aesthetics (colors, separators)
│   └── embellish.cu
├── main.cpp
├── preprocess.py
├── CMakeLists.txt
├── README.md
└── NN.md                    # architecture docs & dictionary

Requirements

  • CUDA-capable GPU (tested on RTX 2050)
  • CUDA Toolkit
  • CMake >= 3.24
  • C++17

WIP

  • python/metrics.py — ROC/precision/recall visualization from CSV
  • python/post_nn_views.py — results display
  • Web interface: images, note pyramids...
  • When to use: 'morning', 'office', 'date', 'home'...

About

Using a small neural network programmed in C++/CUDA to classify fragrances extracted from a dataset sourced from Fragrantica.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages