{"id":13704708,"url":"https://github.com/bukka/php-fann","last_synced_at":"2025-04-09T13:09:59.165Z","repository":{"id":5971739,"uuid":"7193465","full_name":"bukka/php-fann","owner":"bukka","description":"PHP wrapper for FANN (Fast Artificial Neural Network Library)","archived":false,"fork":false,"pushed_at":"2024-02-21T22:00:22.000Z","size":301,"stargazers_count":215,"open_issues_count":11,"forks_count":36,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-02T11:08:00.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bukka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2012-12-16T18:13:33.000Z","updated_at":"2025-02-07T22:19:12.000Z","dependencies_parsed_at":"2024-10-15T04:02:45.394Z","dependency_job_id":null,"html_url":"https://github.com/bukka/php-fann","commit_stats":{"total_commits":269,"total_committers":7,"mean_commits":38.42857142857143,"dds":0.4423791821561338,"last_synced_commit":"2f48c8b3920923c827902e9716b82e4c70397858"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukka%2Fphp-fann","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukka%2Fphp-fann/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukka%2Fphp-fann/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukka%2Fphp-fann/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bukka","download_url":"https://codeload.github.com/bukka/php-fann/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045245,"owners_count":21038554,"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":[],"created_at":"2024-08-02T21:01:18.539Z","updated_at":"2025-04-09T13:09:59.144Z","avatar_url":"https://github.com/bukka.png","language":"C","funding_links":[],"categories":["配置 Configuration"],"sub_categories":["机器学习 Machine Learning"],"readme":"# PHP FANN wrapper\n\nThis is a PHP wrapper for [FANN (Fast Artificial Neural Network) library](http://leenissen.dk/fann/wp/).\n\n## API\n\nThe API is documented on http://www.php.net/manual/en/book.fann.php where is the complete documentation for PHP FANN.\n\nThe API is very similar to the official [FANN C API](http://leenissen.dk/fann/html/files/fann-h.html). Just functions for fixed `fann_type` have not been mapped because PHP always support `float`. In addition unnecessary arguments for some functions have been left out (for example array length that is not necessary for PHP arrays).\n\n## Installation\n\nThe extension can be installed on Linux and Windows.\n\n### Linux\n\nBefore you start installation make sure that `libfann` is installed on your system. It's part of the main repository in the most Linux distributions (search for `fann`). If not you need to install it first. Either download it from the [official site](http://leenissen.dk/fann/wp/) or get it from your distro repository. For example on Ubuntu:\n```\n$ sudo apt-get install libfann-dev\n```\nFann installation can be skipped if an RPM for Fedora is used (`libfann` is in the package dependencies).\n\nIf the library is re-installed manually, then all old library file should be removed before re-installing otherwise the old library version could be linked.\n\n#### Fedora\n\nThe RPM package for PHP FANN is available in Remi's repository: http://rpms.famillecollet.com/\n\nIt is available for Fedora, RHEL and clones (CentOS, SC and others).\n\nAfter downloading remi-release RPM, the package can be installed by executing following command:\n```\n$ sudo yum --enablerepo=remi install php-pecl-fann\n```\n\n#### PECL\n\nThis extension is available on PECL. The installation is very simple. Just run:\n\n```\n$ sudo pecl install fann\n```\n\n#### Manual Installation\n\nIt's important to have a git installed as it's necessary for recursive fetch of\n[phpc](https://github.com/bukka/phpc).\n\nFirst clone recursively the repository\n```\ngit clone --recursive https://github.com/bukka/php-fann.git\n```\n\nThen go to the created source directory and compile the extension. You need to have a php development package installed (command `phpize` must be available).\n```\ncd php-fann\nphpize\n./configure --with-fann\nmake\nsudo make install\n```\n\nIf you are rebuilding the extension and see warning about Libtool version mismatch error, try to run `phpize --clean` or if it doesn't help, try\n```\naclocal \u0026\u0026 libtoolize --force \u0026\u0026 autoreconf\n```\nand then run the compilation steps starting with `phpize` again.\n\nFinally you need to add\n```\nextension=fann.so\n```\nto the php.ini\n\n### Windows\n\nPrecompiled binary `dll` libraries for php-fann and libfann are available on [the PECL fann page](http://pecl.php.net/package/fann). The compiled version of libfann is 2.2.\n\n## Examples\n\nThere are three example projects: [Logic Gates](examples/logic_gates/), [OCR](examples/ocr/) \u0026 [Pathfinder](examples/pathfinder/).\n\n#### Logic Gates\n\n###### Simple\n\nThe Simple example trains a single neural network to perform the XOR operation.\n\n[simple_train.php](examples/logic_gates/simple_train.php)\n\n[simple_train_epoch.php](examples/logic_gates/simple_train_epoch.php)\n\n[simple_test.php](examples/logic_gates/simple_test.php)\n\n[simple_merge.php](examples/logic_gates/simple_test.php) \n\n\n###### All\n\nThe All example trains 7 seperate neural networks to perform the AND, NAND, NOR, NOT, OR, XNOR \u0026 XOR operations.\n\n[train_all.php](examples/logic_gates/train_all.php)\n\n[test_all.php](examples/logic_gates/test_all.php)\n\n\n#### OCR\n\nOCR is a practical example of Optical Character Recognition using FANN. While this example is limited and does make mistakes, the concepts illustrated by OCR can be applied to a more robust stacked network that uses feature extraction and convolution layers to recognize text of any font in any size image. \n\n[train_ocr.php](examples/ocr/train_ocr.php)\n\n[test_ocr.php](examples/ocr/test_ocr.php)\n\n\n\n#### Pathfinder\n\nPathfinder is an example of a neural network that is capable of plotting an 8 direction step path from a starting position in a 5x5 grid to an ending position in that grid. To keep the Pathfinder example simple it is not trained to deal with walls or non-traversable terrain however it would be very easy to add that by adding additional training.\n\n[pathfinder_train.php](examples/pathfinder/pathfinder_train.php)\n\n[pathfinder_test.php](examples/pathfinder/pathfinder_test.php)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbukka%2Fphp-fann","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbukka%2Fphp-fann","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbukka%2Fphp-fann/lists"}