Poprawa
This commit is contained in:
parent
b5aa20748c
commit
9bff7908ee
135
raport.md
135
raport.md
@ -1,50 +1,85 @@
|
|||||||
#Podprojekt Szi
|
# Podprojekt Szi
|
||||||
|
|
||||||
###Opis
|
### Opis
|
||||||
|
|
||||||
Tematem podprojektu jest rozpoznawanie posiłków.
|
Tematem podprojektu jest rozpoznawanie posiłków.
|
||||||
Użyty jest algorytm genetyczny.
|
Użyty jest algorytm genetyczny.
|
||||||
|
|
||||||
###Dane
|
### Dane
|
||||||
|
|
||||||
Posiłki, ich nazwa oraz rodzaj.
|
Posiłki, ich nazwa oraz rodzaj.
|
||||||
|
|
||||||
#####
|
#####
|
||||||
|
|
||||||
menu = Context.fromstring(''' |meat|salad|meal|drink|cold|hot |
|
menu = Context.fromstring(''' |meat|salad|meal|drink|cold|hot |
|
||||||
Pork | X | | X | | | X |
|
Pork | X | | X | | | X |
|
||||||
Espresso | | | | X | | X |
|
Espresso | | | | X | | X |
|
||||||
Green Tea | | | | X | X | |
|
Green Tea | | | | X | X | |
|
||||||
Greek Salad| | X | X | | X | |
|
Greek Salad| | X | X | | X | |
|
||||||
Pizza | | | X | | | X |''')
|
Pizza | | | X | | | X |''')
|
||||||
|
|
||||||
|
|
||||||
|
Za pomocy graphviz możemy narysować grafy z poniższego kodu:
|
||||||
###Implementacja
|
#####
|
||||||
|
|
||||||
Główna część:
|
digraph Lattice {
|
||||||
#####
|
node [label="" shape=circle style=filled width=.25]
|
||||||
|
edge [dir=none labeldistance=1.5 minlen=2]
|
||||||
gen_num = 20 #generations
|
c0
|
||||||
gen_sol = 6 #solutions
|
c1
|
||||||
gen_par_mating = 2 #how many solutions we select
|
c1 -> c1 [color=transparent headlabel=Pork labelangle=270]
|
||||||
|
c1 -> c1 [color=transparent labelangle=90 taillabel=meat]
|
||||||
mut_per_gen = 10
|
c1 -> c0
|
||||||
mut_num_gen = None
|
c2
|
||||||
|
c2 -> c2 [color=transparent headlabel="Green Tea" labelangle=270]
|
||||||
crossover = "two_points"
|
c2 -> c2 [color=transparent labelangle=90 taillabel=cold]
|
||||||
muta_type = "scramble"
|
c2 -> c0
|
||||||
par_keep = 1 #keep only one parent
|
c3
|
||||||
|
c3 -> c3 [color=transparent headlabel="Greek Salad" labelangle=270]
|
||||||
init_range_l = -2 #low
|
c3 -> c3 [color=transparent labelangle=90 taillabel=salad]
|
||||||
init_range_h = -5 #high
|
c3 -> c0
|
||||||
...
|
c4
|
||||||
|
c4 -> c4 [color=transparent headlabel=Espresso labelangle=270]
|
||||||
|
c4 -> c4 [color=transparent labelangle=90 taillabel=drink]
|
||||||
###Biblioteki
|
c4 -> c2
|
||||||
|
c5
|
||||||
* concepts
|
c5 -> c1
|
||||||
* pygad (algorytm genetyczny)
|
c5 -> c3
|
||||||
* random
|
c5 -> c4
|
||||||
* numpy
|
}
|
||||||
|
|
||||||
|
Dane testowe:
|
||||||
|
##
|
||||||
|
func_input = ['meal']
|
||||||
|
Dane wyjściowe:
|
||||||
|
##
|
||||||
|
['Pork', 'Greek Salad', 'Pizza']
|
||||||
|
|
||||||
|
### Implementacja
|
||||||
|
|
||||||
|
Główna część:
|
||||||
|
#####
|
||||||
|
|
||||||
|
gen_num = 20 #generations
|
||||||
|
gen_sol = 6 #solutions
|
||||||
|
gen_par_mating = 2 #how many solutions we select
|
||||||
|
|
||||||
|
mut_per_gen = 10
|
||||||
|
mut_num_gen = None
|
||||||
|
|
||||||
|
crossover = "two_points"
|
||||||
|
muta_type = "scramble"
|
||||||
|
par_keep = 1 #keep only one parent
|
||||||
|
|
||||||
|
init_range_l = -2 #low
|
||||||
|
init_range_h = -5 #high
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
### Biblioteki
|
||||||
|
|
||||||
|
* concepts
|
||||||
|
* pygad (algorytm genetyczny)
|
||||||
|
* random
|
||||||
|
* numpy
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user