Code Monkey home page Code Monkey logo

hands-on-machine-learning-with-cpp's Introduction

Hands-On-Machine-Learning-with-C++

Hands-On Machine Learning with C++

This is the code repository for Hands-On Machine Learning with C++, published by Packt.

Build, train, and deploy end-to-end machine learning and deep learning pipelines

What is this book about?

This book will help you explore how to implement different well-known machine learning algorithms with various C++ frameworks and libraries. You will cover basic to advanced machine learning concepts with practical and easy to follow examples. By the end of the book, you will be able to build various machine learning models with ease.

This book covers the following exciting features:

  • Explore how to load and preprocess various data types to suitable C++ data structures
  • Employ key machine learning algorithms with various C++ libraries
  • Understand the grid-search approach to find the best parameters for a machine learning model
  • Implement an algorithm for filtering anomalies in user data using Gaussian distribution
  • Improve collaborative filtering to deal with dynamic user preferences
  • Use C++ libraries and APIs to manage model structures and parameters
  • Implement a C++ program to solve image classification tasks with LeNet architecture

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders.

The code will look like the following:

class Network {
  public:
    Network(const std::string& snapshot_path,
            const std::string& synset_path,
            torch::DeviceType device_type);
    std::string Classify(const at::Tensor& image);
  private:
    torch::DeviceType device_type_;
    Classes classes_;
    torch::jit::script::Module model_;
};

Following is what you need for this book: You will find this C++ machine learning book useful if you want to get started with machine learning algorithms and techniques using the popular C++ language. As well as being a useful first course in machine learning with C++, this book will also appeal to data analysts, data scientists, and machine learning developers who are looking to implement different machine learning models in production using varied datasets and examples. Working knowledge of the C++ programming language is mandatory to get started with this book.

With the following software and hardware list you can run all code files present in the book (Chapter 1-13).

Software and Hardware List

Chapter Software required OS required
1 - 13 C++, Python 3.5+, Android SDK, Google Cloud Platform (trial version) Windows, Mac OS X, and Linux (Any)

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Related products

Get to Know the Author

Kirill Kolodiazhnyi is a seasoned software engineer with expertise in custom software development. He has several years of experience building machine learning models and data products using C++. He holds a bachelor degree in Computer Science from the Kharkiv National University of Radio-Electronics. He currently works in Kharkiv, Ukraine where he lives with his wife and daughter.

Suggestions and Feedback

Click here if you have any feedback or suggestions.

hands-on-machine-learning-with-cpp's People

Contributors

manikandankurup-packt avatar packt-itservice avatar packtutkarshr avatar

Stargazers

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

Watchers

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

hands-on-machine-learning-with-cpp's Issues

Running Code

I'm attempting to run the code examples in Visual Studio. What project type should I create? A cmake or console application?

These files don't contain vsproj files, so I can't directly open them as a solution. Please help.

Chapter 3 SharkML cmake config errors | Boost Serialization

Note that I've attempted this with both the system package installed Boost (version 1.74) as well as built Boost myself (version 1.80) with the same results.

clint@sweetz:~/code/git/Hands-On-Machine-Learning-with-CPP/Chapter03/sharkml/build$ cmake ..
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
SharkML path is /home/clint/code/git/Shark
plotcpp path is /home/clint/code/git/plotcpp
CMake Error at /usr/local/lib/cmake/Boost-1.80.0/BoostConfig.cmake:141 (find_package):
  Found package configuration file:

    /usr/local/lib/cmake/boost_serialization-1.80.0/boost_serialization-config.cmake

  but it set boost_serialization_FOUND to FALSE so package
  "boost_serialization" is considered to be NOT FOUND.  Reason given by
  package:

  No suitable build variant has been found.

  The following variants have been tried and rejected:

  * libboost_serialization.so.1.80.0 (shared, Boost_USE_STATIC_LIBS=ON)

  * libboost_serialization.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)

Call Stack (most recent call first):
  /usr/local/lib/cmake/Boost-1.80.0/BoostConfig.cmake:262 (boost_find_component)
  /usr/share/cmake-3.22/Modules/FindBoost.cmake:594 (find_package)
  CMakeLists.txt:25 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/clint/code/git/Hands-On-Machine-Learning-with-CPP/Chapter03/sharkml/build/CMakeFiles/CMakeOutput.log".

For Boost::Serialization, in /usr/local/lib I have three serialization files:
libboost_serialization.a
libboost_serialization.so
libboost_serialization.so.1.80.0

If I disable either of the "Boost_USE_STATIC_LIBS " or "Boost_USE_STATIC_RUNTIME" (or both), the binaries compile and link but immediately segfault on run.

I'm not sure what to try next if anyone can help me with what to do. I'm happy to provide any other details required.

What are the minimum hardware requirements?

I have been attemping to build the docker container inside an Arch virtual machine. I have hardware pass thru, 3 cpu cores dedicated to the VM, 8 GB of memory, and 32 GB dedicated storage.

After I run the docker file and run install_env.sh inside the development directory it works fine until 78% of the way thru shogun build. At that point it just hangs. No errors, no updates. It doesn't appear to freeze. It just sits there. I have attempted the build multiple time. The shortest time that I've let it run was 10 hrs. Same result each time.

broken SHA for armadillo?

Was there some history rewriting on armadillo repo? Seems that git checkout 442d52ba052115b32035a6e7dc6587bb6a462dec gives following error:
fatal: reference is not a tree: 442d52ba052115b32035a6e7dc6587bb6a462dec

Can you check with git log if there's a branch "close" to that commit (e.g. 8.600.x)?

don't know how to run the code examples

I have an experience with cpp but not cmake i have spend the last 2 days trying to configure the libraries to work in my system but i couldn't !
i really want help
what i do is the following:

  1. tried to install them with something called conan but in vain 90% of them didn't exists in conan
  2. read about cmake and learned how to install them i tried to do it with pytorch first because i alread know how to work with it but get a lot of error tried to figure out how to solve them like cudnn version is not exist ..etc but there is something wrong.
  3. i asked help from a lot of people and communities but there is no useful help yet.
  4. the last thing i tried to do is i downloaded the code sample for the book and go to the folder build scripts then i run it but get a lot of errors again. i know that in the LIBS_DIR is sould give pass to configuration but i don't know what is configuration he is talking about
  5. i want to read this book and take this challenge i spend a lot of time and didn't want to stop now! is there any other ways to run the code vm ,docker what i really missing why it's really hard to add just a thrid-library in cpp world i do it easly with conda in python and cargo in Rust ..javascript!!!!
    please any help!

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.