{"id":26145694,"url":"https://github.com/carlowood/machine-learning","last_synced_at":"2025-04-14T03:09:26.420Z","repository":{"id":207451360,"uuid":"711288268","full_name":"CarloWood/machine-learning","owner":"CarloWood","description":"My first ML sandbox","archived":false,"fork":false,"pushed_at":"2024-12-06T20:09:14.000Z","size":322,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T03:09:14.207Z","etag":null,"topics":["cpp","cpp20","machine-learning","machinelearning","neural-network","neural-networks","neural-networks-from-scratch","neuralnetwork","neuralnetworks","tensorflow","tensorflow2"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CarloWood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-28T19:22:37.000Z","updated_at":"2025-01-09T23:20:35.000Z","dependencies_parsed_at":"2023-11-25T20:22:09.657Z","dependency_job_id":"497363af-a806-4e91-8036-3e2ee5d5694d","html_url":"https://github.com/CarloWood/machine-learning","commit_stats":null,"previous_names":["carlowood/machine-learning"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarloWood%2Fmachine-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarloWood%2Fmachine-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarloWood%2Fmachine-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarloWood%2Fmachine-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarloWood","download_url":"https://codeload.github.com/CarloWood/machine-learning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813795,"owners_count":21165634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp20","machine-learning","machinelearning","neural-network","neural-networks","neural-networks-from-scratch","neuralnetwork","neuralnetworks","tensorflow","tensorflow2"],"created_at":"2025-03-11T04:54:43.630Z","updated_at":"2025-04-14T03:09:26.393Z","avatar_url":"https://github.com/CarloWood.png","language":"C++","readme":"This is an ongoing effort to do Machine Learning in pure C++,\nleveraging Tensorflow to make it run on the GPU.\n\nTo compile this project you need linux with TensorflowCC;\nsince the latter is rather hard to compile yourself, I recommend\nto use Arch (or another distribution if that provides a pre-packed\ntensorflow_cc).\n\nUSING DOCKER\n============\n\nAs an alternative you can work on this project in a docker\ncontainer; which even works on Windows! Start the docker\ncontainer from wsl in that case (installing the project\ndirectly in wsl doesn't work very well it seems).\n\nRead https://github.com/CarloWood/machine-learning/tree/master/docker#readme\nfor an explanation of how to construct the container and run it.\n\nOnce inside the docker container (you are then in the directory\n/home/archuser/machine-learning), run:\n\n```\n                   docker:~/machine-learning\u003e git clone --recursive https://github.com/CarloWood/machine-learning.git\n                   docker:~/machine-learning\u003e cd machine-learning\n  docker:~/machine-learning/machine-learning\u003e ./autogen.sh\n  docker:~/machine-learning/machine-learning\u003e cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DEnableCairoWindowTests:BOOL=ON\n  docker:~/machine-learning/machine-learning\u003e cmake --build build --config Debug --parallel $(nproc --all)\n  docker:~/machine-learning/machine-learning\u003e cd build/cairowindow/tests\n  docker:~/machine-learning/machine-learning\u003e ./quadratic_bezier\n```\n\nCOMPILING ON A LINUX HOST\n=========================\n\nThis works the same as in docker, except that in this case you have to set\nup the build environment yourself.\n\nOn Archlinux you need to following packages:\n\n```\n  sudo pacman -S git clang make pkgconfig cmake boost pango cairo eigen tensorflow-opt ttf-dejavu ccache\n```\n\nThe last two are not absolutely required, but you really want to install them.\n\nIf you have an NVidia GPU you could use `tensorflow-opt-cuda` instead (but cuda is VERY large\nand annoying to download / upgrade; I recommend against installing it if you do not already\nhave it anyway).\n\nYou also need packages that are on github, but not provided by arch (or typically any distribution).\nThe project automatically clones, configures, compiles and installs those packages using `gitache`.\nFor `gitache` to work you need to specify a directory that it can use for all of the above; this\ndirectory must be writable by you (and preferably empty when we start).\n\nFor example, if you use `/opt/gitache`, you will need:\n\n```\n  export GITACHE_ROOT=/opt/gitache\n  sudo mkdir $GITACHE_ROOT\n  sudo chown $(id -u):$(id -g) $GITACHE_ROOT\n```\n\nOf course, you can put also in your home directory if you think the partition of your\nhome directory is large enough.\n\nUsually it is necessary to run `./autogen.sh` after cloning a repository for the first time.\nIn order for that script to only set things up for cmake, and not automake, you want to\nset the following environment variable:\n\n```\n  export AUTOGEN_CMAKE_ONLY=1\n```\nor just set it while running autogen.sh, like so: `AUTOGEN_CMAKE_ONLY=1 ./autogen.sh`.\n\nYou also need to set the following environment variables in order to find TensorflowCC:\n```\n  export TENSORFLOW_PREFIX=/usr\n  export TensorflowCC_DIR=/thefullpath/to/machine-learning/cmake\n```\nThese work for Archlinux - if your tensorflow is installed elsewhere you might\nhave to change them! For example, if your install already provides `TensorflowCCConfig.cmake` et al,\nthen `TensorflowCC_DIR` should point there.\n\nFinally add the following file as `~/.libcwdrc` in your home directory:\n```\nsilent = on\nchannels_default = off\n\nchannels_on = warning,debug,notice\n\ngdb = /usr/bin/gdb -x $REPOBASE/.gdbinit $GDBCOMMANDFILE\nxterm = konsole --name \"attach_gdb\" --hide-menubar --nofork --workdir \"$PWD\" --geometry 165x24-0-0 -e %s\n```\nor, if you already have that file, make sure that the debug channels `warning`, `debug` and `notice` are on.\nNote how this uses `$REPOBASE`. Therefore, in order to make `attach_gdb()` work from within the\nprogram you should also add to your environment:\n```\nexport REPOBASE=/full/path/to/machine-learning\n```\nUsing the directory name of where you cloned this project. Namely, the repository contains a `.gdbinit` which then will be loaded.\n\nAfter all of this is set up, you can do the same as listed above for docker (`git clone`, etc).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlowood%2Fmachine-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlowood%2Fmachine-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlowood%2Fmachine-learning/lists"}