prolog_genetic_programming
所属分类:人工智能/神经网络/深度学习
开发工具:Prolog
文件大小:0KB
下载次数:0
上传日期:2023-06-26 11:39:45
上 传 者:
sh-1993
说明: prolog中的遗传编程,
(genetic programming in prolog,)
文件列表:
LICENSE (35149, 2023-06-26)
example.pl (2526, 2023-06-26)
load.pl (131, 2023-06-26)
run.pl (302, 2023-06-26)
run.sh (114, 2023-06-26)
src/ (0, 2023-06-26)
src/core.pl (820, 2023-06-26)
src/genetic_programming.pl (4480, 2023-06-26)
src/genetic_programming.plt (1609, 2023-06-26)
src/optimizer.pl (4789, 2023-06-26)
src/optimizer.plt (1214, 2023-06-26)
src/tasks.pl (5718, 2023-06-26)
src/tasks.plt (2077, 2023-06-26)
test.sh (94, 2023-06-26)
# prolog_genetic_programming
genetic programming in prolog
we were inspired by the genetic programming example in python from [lowerkey/genetic_programming](https://github.com/lowerkey/genetic_programming)
## Builtin Task, Overfitting on a string
#### running from cli
for ease of use, you can use the shell script run.sh on linux
or look into run.sh to see how to invoke swipl
```
./run.sh
```
#### running manually
run swi-prolog, load the algorithm, and run it.
this runs the genetic programming to overfit on the string "Hello" and prints the genes for every iteration.
```
swipl
?- [load].
?- genetic_programming:genetic_programming("Learn_String_with_levenshtein", "stringopt", EvolutionHistory), EvolutionHistory = [ LastEpoch | _ ], writeln(LastEpoch), !.
?- genetic_programming:genetic_programming("Learn_String_with_quadratic", "stringopt", EvolutionHistory), EvolutionHistory = [ LastEpoch | _ ], writeln(LastEpoch), !.
```
## Adding your own task, example.pl
You can add and redefine operations in your own external scripts through dynamic predicates.
In example.pl we define a new task and change the required operations.
you can run example.pl like follows:
```
?- [example].
```
近期下载者:
相关文件:
收藏者: