Git Product home page Git Product logo

pec-css / slowmokit Goto Github PK

View Code? Open in Web Editor NEW
17.0 6.0 16.0 1.83 MB

Library which can be used for machine learning in C++.

Home Page: https://pec-css.github.io/slowmokit/

License: GNU General Public License v2.0

C++ 23.72% CMake 36.82% Rust 29.54% Shell 9.93%
cpp machine-learning ml-library classification-algorithm clustering cplusplus cplusplus-20 machine-learning-algorithms regression-models slowmokit

slowmokit's Introduction

slowmokit logo

Slowmokit

ML kit in C++.

Header-only library which can be used for machine learning in C++.

Installation guide

To use this library locally

Prerequisites

Then following command will install the library

./scripts/install

If permission is required to execute, run the following command

chmod 705 ./scripts/install

Compile and run

To compile and run the code written using this library, you need to add the following flags along with the standard commands.

For example, you want to run hello.cpp and it has slowmokit dependencies.

g++ -std=c++17 -larmadillo hello.cpp -o hello && ./hello

Steps to contribute

Following are the steps to start contributing to our beautiful library:

  1. Install an IDE, preferably CLion.
  2. Fork this repo.
  3. Clone the forked repo, using git clone https://github.com/<your_username>/slowmokit.git.

After this,

You can directly use the executable file by running ./bin/nim in the root folder of library, to do the required configurations.

If it does not work then you need to configure everything by your own.

Configuring everything own

  1. Make the model directory you want to implement in the include/slowmokit/<model type>/<your_model>.

    • <model type> is basically the class of your model, for example linear_model or cluster.
  2. Create two files:

    • <model>.hpp : the header file for the model, create the class of model here and include all the stuff required for the model here.
      • Include core.hpp for all the basic functionalities already added.
      • Make sure to add doc comments above each function signature (refer other files for the format)
      • Variable and function names should be in camel case and class names should be in pascal case in all files.
    • <model>.cpp : implement the functions of the class here.
  3. Add the header file <model>.hpp in src/slowmokit.hpp under the documentation block as shown here. More on documentation block.

  4. Test the working by building in IDE.

This step is mandatory

  1. Format the files according to the convention. For simplicity, run ./scripts/clang-format-all include/ in gitbash(if on windows) or in terminal(if on linux/macos)

For this you need to have clang-format binaries installed in the machine.

To do that, run the following in the terminal

# with npm (windows)
npm install -g clang-format
# you have to restart terminal in case of windows

# with homebrew (macos)
brew install clang-format

# linux (Ubuntu)
sudo apt install clang-format

NOTE: Do NOT use #include <bits/stdc++.h> in any file, all the major header files are already included in core.hpp.]

Example

Once the algorithm is ready, run and test it. After testing, push it in the examples directory, with proper comments and instructions. With same directory structure as in include.

Documentation

Push the docs of the model in a <model>.md file in same directory structure in docs folder.

Pull Request (PR) format

After code is ready, you can make PR to the main branch. PR will be accepted only if:

  • Code pass the CI tests.
  • Example is pushed.
  • Code has proper comments and instructions.

GOOD LUCK!

slowmokit's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

slowmokit's Issues

Implement matmul, subtract, add function.

  • Add function signature for each function inside the Matrix class in matrix.hpp and also implement in matrix.cpp.

  • Function specifications:

    • matmul: Multiplies two Matrices. A Matrix and a scalar is not allowed. Also throw appropriate exception if matrix dimension are not compatible for multiplication.
    • add: This function will have two overloads one which will add matrix and scalar and the other one for two matrices. Throw appropriate exceptions if matrix have incompatible dimensions.
    • subtract: Everything same as add function but you should do subtraction instead of addition.
  • Don't implement from scratch, use the already implemented functions operator +=, operator -= and operator *=. This way you will not have to worry about throwing appropriate exceptions as the already implemented function will do it for you.

  • Don't forget to add comments above each function signature you add in matrix.hpp. Avoid adding comments in matrix.cpp unless very important.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.