-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.html
783 lines (606 loc) · 36.1 KB
/
doc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PyGeneses - Documentation</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800,900" rel="stylesheet">
<link rel="stylesheet" href="global.css">
<link rel="stylesheet" href="doc.css">
</head>
<body>
<div class="doc__bg"></div>
<nav class="header">
<h1 class="logo">PyGeneses</h1>
<ul class="menu">
<div class="menu__item toggle"><span></span></div>
<li class="menu__item"><a href="https://github.com/Project-DC/pygeneses" class="link link--dark"><i class="fa fa-github"></i> Github</a></li>
<li class="menu__item"><a href="index.html" class="link link--dark"><i class="fa fa-home"></i> Home</a></li>
</ul>
</nav>
<div class="wrapper">
<aside class="doc__nav">
<ul>
<li class="js-btn selected">Introduction</li>
<li class="js-btn">Use cases</li>
<li class="js-btn">Installation</li>
<li class="js-btn">About packages</li>
<li class="js-btn">Agents</li>
<li class="js-btn">Examples</li>
<li class="js-btn">Classes</li>
<li class="js-btn">Highlights</li>
</ul>
</aside>
<article class="doc__content">
<section class="js-section">
<h3 class="section__title">Introduction</h3>
<p style="text-align: justify;">PyGeneses is a PyTorch based Deep Reinforcement Learning framework
that helps users to simulate artificial agents in bio-inspired environments. The framework
provides in-built Deep RL algorithms and visualization of results from training in an interactive
dashboard. The environments are a simplified abstraction of our real world, agents are put into this
world and are allowed to interact with each other and the environment. PyGeneses has been
recently open sourced under GNU GPL v3. For a TLDR - <a href="#highlights">TLDR;</a></p>
<p style="text-align: justify;">The power of PyGeneses is its clean and simple API which:</p>
<ol>
<li>
<p style="text-align: justify;">Allows a user to run own simulation even if they have no knowledge
about RL or DL.</p>
</li>
<li>
<p style="text-align: justify;">Allows a user with experience in Deep RL to tweak the model
and parameters extensively.</p>
</li>
</ol>
<p style="text-align: justify;">What’s exciting about PyGeneses you ask, well, PyGeneses lets you
create a working simulation by writing as little as 2 lines without any prerequisite knowledge
whatsoever!! PyGeneses also provides tools that will help you visualize the results with minimal
effort. So what are you waiting for, install PyGeneses today and become the god of your creation.</p>
</section>
<section class="js-section">
<h3 class="section__title">Use cases</h3>
<p style="text-align: justify;">Pygeneses can be used for a variety of purposes,
the limit only being your creativity and imagination. That being said, some of the
use-cases of pygeneses can be:</p>
<ol>
<li>
<p style="text-align: justify;">
To understand basic psychology - Since every agent has a limited actions to choose from in
each time step, the simulation can be studied to infer the basic psychological patterns displayed,
this can help to understand the similarities/dissimilarities between the agents and real life
organisms.
</p>
</li>
<li>
<p style="text-align: justify;">To create applications/games based on the framework - You can
create basic applications/games based on our framework. An example can be a productivity
app that adds food to the simulation only when the user completes a task, hence staking the
lives of the agents of the user’s own simulation in exchange for productivity.
</p>
</li>
<li>
<p style="text-align: justify;">To learn more about Deep Reinforcement Learning -
Users can just tinker around with different hyperparameters and models and observe
the results visually, this makes for a interesting way to get an insight into the world
of Deep Reinforcement Learning.
</p>
</li>
</ol>
</section>
<section class="js-section">
<h3 class="section__title">Installation</h3>
<p style="text-align: justify;">PyGeneses can be installed using pip in either your local
system or a cloud based platform. The steps for installation will be the same for both
cloud and own systems.</p>
<div class="code__block code__block--notabs">
<pre class="code code--block">
<code>
user@programmer~:$ pip install git+https://github.com/Project-DC/pygeneses
</code>
</pre>
</div>
</section>
<section class="js-section">
<h3 class="section__title">About packages</h3>
<p style="text-align: justify;">As of version 0.1-beta, the architecture of PyGeneses is built around
4 major modules. Each of these modules provides a unique feature or functionality to the framework.
So, let’s get started with a brief introduction to each of them.</p>
<ol>
<li>
<h4 class="section__title">envs</h4>
<p style="text-align: justify;">This module allows you to create, configure and tweak
the in-built bio-inspired environments. As of now, this only provides a single environment
called Prima Vita (First Life), but there’s more coming soon! This lets you set up the entire
environment and the species in just a few lines of code and provides both high level API and low level
control over the environment. Training using the API includes logging of every action of an agent
so that it can be studied using VitaBoard.
</p>
</li>
<li>
<h4 class="section__title">models</h4>
<p style="text-align: justify;">The ‘models’ module is what allows us to import the neural
networks which the species uses to learn what to do. As of now, only the default model's (REINFORCE)
implementation is provided, but we will be adding support for custom pluggable networks from v0.2 onwards.
</p>
</li>
<li>
<h4 class="section__title">hypertune</h4>
<p style="text-align: justify;">The ‘HyperTune’ package allows us to configure and test out
various hyperparameters we can provide for an environment and species (a list of hyperparameters is
provided in the Classes section of this documentation). This contains single
hyperparameter testing, grid search and randomized search. This allows us to find the best
set of hyperparameters to display a type of behavior. This also produces logs which we can
study using Vitaboard.
</p>
</li>
<li>
<h4 class="section__title" id="vitaboard">vitaboard</h4>
<p style="text-align: justify;">Vitaboard provides an advanced, interactive dashboard to study
agents after the training phase. After each agent dies, his/her actions are written into a
log file. And vitaboard allows us to visualize the agent's life. It provides us with a life
visualizer, group statistics and a genetic history visualizer. It allows us to identify
and understand behaviours exhibited by an agent while interacting with the environment or
with other agents in the environment.
</p>
</li>
</ol>
</section>
<section class="js-section">
<h3 class="section__title">Agents</h3>
<img src="images/player.png" style="display: block; margin: 0 auto;">
<p style="text-align: justify;">Meet ‘100-456’ an agent belonging to Prima vita species. In this
section we will look at how this or any other agent interacts with food particles and other
agents in the Prima Vita environment.</p>
<ul>
<li>
<h4 class="section__title">States</h4>
<p style="text-align: justify;">The state of an agent can be described as the experiences of
the agent at a particular time step in the environment. The state has 3 components - (1)
distance vectors to food particles within a fixed radius, (2) distance vectors to other
agents and their gender within the same radius, and (3) the energy of the agent at the
current time step. The state is padded to a fixed length before being passed to the neural network.
</p>
</li>
<li>
<h4 class="section__title">Actions and reward</h4>
<p style="text-align: justify;">Actions are what the agent chooses to do after experiencing a
particular state. An agent in the Prima Vita environment can choose form 13 different actions:-
</p>
<table id="customers">
<tr>
<th>S.No</th>
<th>Action</th>
<th>Reward</th>
</tr>
<tr>
<td>01</td>
<td>Move left</td>
<td>-2</td>
</tr>
<tr>
<td>02</td>
<td>Move right</td>
<td>-2</td>
</tr>
<tr>
<td>03</td>
<td>Move up</td>
<td>-2</td>
</tr>
<tr>
<td>04</td>
<td>Move down</td>
<td>-2</td>
</tr>
<tr>
<td>05</td>
<td>Move up then left (North west)</td>
<td>-2</td>
</tr>
<tr>
<td>06</td>
<td>Move up then right (North east)</td>
<td>-2</td>
</tr>
<tr>
<td>07</td>
<td>Move down then left (South east)</td>
<td>-2</td>
</tr>
<tr>
<td>08</td>
<td>Move down then right (South west)</td>
<td>-2</td>
</tr>
<tr>
<td>09</td>
<td>Stay at one place</td>
<td>-4 (decays to -1)</td>
</tr>
<tr>
<td>10</td>
<td>Food ingestion</td>
<td>initial_energy / current_energy</td>
</tr>
<tr>
<td>11</td>
<td>Asexual reproduction</td>
<td>initial_energy / current_energy</td>
</tr>
<tr>
<td>12</td>
<td>Sexual reproduction</td>
<td>initial_energy / current_energy</td>
</tr>
<tr>
<td>13</td>
<td>Fighting</td>
<td>-10</td>
</tr>
</table>
<p style="text-align: justify;"><strong><u>Disclaimer</u>:</strong> The current implementation of
sexual reproduction and fighting are done in a way that if an agent takes any of these actions and
another agent (of opposite gender in case of sexual reproduction or any gender in case of
fighting) is present in its radius then the action is completed successfully without the
consent of the other agent. We (the developers) of PyGeneses do not promote non-consensual
sex and fighting, this approach is taken here only for the sake of simplicity.</p>
</li>
<li>
<h4 class="section__title">Log files</h4>
<p style="text-align: justify;">Log files contain information about every action that an agent
takes throughout its lifetime. When an agent dies all that information is dumped into the log file.
This also contains the players initial x-y coordinates in the environment and the id and time of
birth or parent(s). The log file can be used to study the behaviour of the agents using VitaBoard.
The name of a log file is in the following format: time of birth-unique id.npy (now you know why
the agent was named 100-456.npy).
</p>
</li>
</ul>
</section>
<section class="js-section">
<h3 class="section__title">Examples</h3>
<ol>
<li>
<h4 class="section__title">Model Training (pygeneses.envs)</h4>
<ol style="list-style-type: lower-alpha;">
<li>
<h5 class="section__title">Example 1</h5>
<p style="text-align: justify;"><strong><em>Note:</em></strong>
This is training with default Hyperparameter setting and REINFORCE algorithm</p>
<script src="https://gist.github.com/frankhart2018/5e2af613ba737750b6489a56db773deb.js"></script>
<p style="text-align: justify;">The three steps to train agents are:-</p>
<ul>
<li>
<p style="text-align: justify;">Import PrimaVita class from envs.prima_vita</p>
</li>
<li>
<p style="text-align: justify;">Instantiate the PrimaVita class</p>
</li>
<li>
<p style="text-align: justify;">Call the run( ) method on the PrimaVita object</p>
</li>
</ul>
<p style="text-align: justify;">The above default setting will allow you to train the agents
in ‘bot’ mode which means you will not be able to see the environment while training.
In case, you want to see the environment throughout the training you just need to change
the mode to ‘human’. The snippet belows shows the code for 'human' mode.</p>
<script src="https://gist.github.com/frankhart2018/a638d5e8287a3461c2bb949928b4f19a.js"></script>
</li>
<li>
<h5 class="section__title">Example 2</h5>
<p style="text-align: justify;"><strong><em>Note:</em></strong>
Changing the default hyperparameters</p>
<script src="https://gist.github.com/frankhart2018/40efb6091d89a037ab598c4aab59ddde.js"></script>
<p style="text-align: justify;">You just have to pass a dictionary with keys as the name
of the hyperparameter (here the initial energy of agents and the time in ticks after
which model will be updated are changed) and the values as the value you want to specify.
For a more detailed list of available hyperparameters refer to the
<a href="#primavita">Classes</a> section.</p>
</li>
</ol>
</li>
<li>
<h4 class="section__title">Hypertune (pygeneses.hypertune)</h4>
<ol style="list-style-type: lower-alpha;">
<li>
<h5 class="section__title">Grid Search</h5>
<p style="text-align: justify;">This takes in a pool of hyperparameter values as
input and trains the model with all the possible combinations of these values.
This is useful when you want to try out different values of a hyperparameter or group
of hyperparameters.</p>
<p style="text-align: justify;">
Following is a snippet of code for applying a grid search over pool of hyperparameters
using hypertune:-</p>
<script src="https://gist.github.com/frankhart2018/3cee63273f1e32ed4e5092d1c787ebe2.js"></script>
</li>
<li>
<h5 class="section__title">Randomized Search</h5>
<p style="text-align: justify;">
This takes in a pool of hyperparameter values as input and but unlike Grid Search, it
trains the model only on a handful of combinations which is a subset of all possible combinations
and the combinations in this subset is chosen randomly based on a probability</p>
<p style="text-align: justify;">Following is a snippet of code for applying a randomised
search over a pool of hyperparameters using hypertune:-</p>
<script src="https://gist.github.com/frankhart2018/302e9eb206a79bbb8f3acb8cc146a6d0.js"></script>
<p style="text-align: justify;">The only change in this code and the grid search code is the
extra parameter randomize_percent (between 0 and 1) which tells the randomized search algorithm the
percentage of combinations to pick up randomly from the pool of available hyperparameters.</p>
</li>
</ol>
</li>
<li>
<h4 class="section__title">Vitaboard (pygeneses.vitaboard)</h4>
<p style="text-align: justify;">VitaBoard is installed with PyGeneses, so you do not need to install VitaBoard separately. To run VitaBoard just run the following command from your terminal:</p>
<div class="code__block code__block--notabs">
<pre class="code code--block">
<code>
user@programmer~:$ vitaboard
</code>
</pre>
</div>
<ol style="list-style-type: lower-alpha;">
<li>
<h5 class="section__title">Steps to run</h5>
<ul>
<li><p style="text-align: justify;">Run the command vitaboard in your terminal</p></li>
<li><p style="text-align: justify;">Open localhost:5000 or 127.0.0.1:5000 in any browser</p></li>
</ul>
</li>
<li>
<h5 class="section__title">VitaViz</h5>
<p style="text-align: justify;">
The first thing you see after opening vitaboard is this window:</p>
<img src="images/vitaviz.JPG" style="width: 110%;">
<p style="text-align: justify;">This is the VitaViz Tab. Here you need to enter the path of
the log file that you want to visualize in first field and the speed at which you want to
visualise the simulation in the second field ( an Input of 1 means the simulation will
be shown at 1 frame/s).</p>
<p style="text-align: justify;">After entering the required fields and hitting ‘Run’,
a pygame window will open which will display the simulation:</p>
<img src="images/visualizer.JPG" style="width: 110%;">
</li>
<li>
<h5 class="section__title">VitaGroups</h5>
<p style="text-align: justify;">The second tab is VitaGroups, which is used to form clusters
of agents (based on their Neural Network embeddings). This tab looks something like this:</p>
<img src="images/vitagroups.JPG" style="width: 110%;">
<p style="text-align: justify;">After entering the address on the directory containing the log
files, press ‘Get Groups’, this will generate and show you the clusters.
These data points are generated by reducing the dimensionality of the agent’s trained
embeddings into two dimensions using t-SNE (t-distributed Stochastic Neighbour Embeddings).</p>
<img src="images/tsne.JPG" style="width: 110%;">
<p style="text-align: justify;">Here you can click on any node and the name of that player
will be displayed below, clicking on the name will enable you to visualize the life of that
player (similar to VitaViz).</p>
</li>
<li>
<h5 class="section__title">VitaStats</h5>
<p style="text-align: justify;">The next tab is VitaStats which helps us visualise various
statistics about the agents (players).</p>
<img src="images/vitastats.png" style="width: 110%;">
<p style="text-align: justify;">After entering the address of the folder in the field, hit
‘Get Stats’, Various graphs will be generated and displayed.</p>
<img src="images/stats.png" style="width: 110%;">
<p style="text-align: justify;">Here you can click on any node to get a list of players born
at that time-step. Clicking on any element of the list will enable you to visualize the
life of the player.</p>
<p style="text-align: justify;">The First Graph shows the relation between the average of
the ages of death of players born at a particular time and the time. This can be used to
study the trends in the lifespans of the agents.</p>
<p style="text-align: justify;">The second graph shows the relation between the variance in
death ages of players born at a particular time and the time. This graph can be used to
realise the similarities/dissimilarities in the death age of players born under at the same
time and living in similar circumstances.</p>
<p style="text-align: justify;">The third graph maps the relation between the Quality of
Life and the time. Here by quality of life we mean the count of players born at a
particular time who survived for more than 50 timesteps (in ticks).</p>
</li>
<li>
<h5 class="section__title">VitaLineage</h5>
<p style="text-align: justify;">The last tab is VitaLineage, here we can pass the address
of the log file of any agent and see their family tree.</p>
<img src="images/vitalineage.JPG" style="width: 110%;">
<p style="text-align: justify;">After entering the address, click on ‘Get Tree’ to see the
family tree of the player.</p>
<img src="images/familytree.JPG" style="width: 110%;">
<p style="text-align: justify;">Click on any node of the tree to visualise the life of the player.</p>
</li>
</ol>
</li>
</ol>
</section>
<section class="js-section">
<h3 class="section__title">Classes</h3>
<ol>
<li>
<h4 class="section__title" id="primavita">PrimaVita()</h4>
<p style="text-align: justify;">The class for our first environment which includes a single species called Prima vita (First life). This is exposed in the front end API from where user can instantiate this class to train their model.</p>
<p style="text-align: justify;">The following are the hyperparameters which can be set for this class:-</p>
<table id="customers">
<tr>
<th>S.No</th>
<th>Hyperparameter</th>
<th>Default Value</th>
<th>Description</th>
</tr>
<tr>
<td>01</td>
<td>initial_population</td>
<td>10</td>
<td>This is the count of agents which will be present when training is started. These people will be born at time step 0.</td>
</tr>
<tr>
<td>02</td>
<td>state_size</td>
<td>21</td>
<td>The size to which the state of an agent is to be padded, if the size of state increases then it will be removed, or if the size of the state for an agent is less than state_size then it will be padded with zeros to this length, otherwise if it is equal to state size then the state remains the same. State is what the agent perceives in its environment (state in our environment is distance vectors to food particles and other agents followed by current energy of an agent, it tells the agent how close it is to another agent or food particle and what is its current energy). The padding length will be 1 less than what is mentioned so as to accomodate the single value - energy. So, the default value of 21 will pad the vectors to 20 length after which energy is appended.</td>
</tr>
<tr>
<td>03</td>
<td>initial_energy</td>
<td>200</td>
<td>The energy with which each player/agent is born. This value will be same for all the agents across various generations and irrespective of how the agent was born or who his/her parent(s) were.</td>
</tr>
<tr>
<td>04</td>
<td>model_updates</td>
<td>10</td>
<td>Number of time step (in ticks) after which the neural network model for all the agents who are currently alive is updated. Here updation means backpropagation through the neural network which the agent uses for predicting action given a state as input.</td>
</tr>
<tr>
<td>05</td>
<td>speed</td>
<td>3</td>
<td>The speed with which an agent moves in a the environment or in simpler terms the number of pixels an agent moves after taking a single step. The default value of 3 means that the agent will move 3 pixels in each of the 8 direction if it takes a step in any of these directions.</td>
</tr>
<tr>
<td>06</td>
<td>max_age</td>
<td>90</td>
<td>The maximum age (in ticks) to which an agent can live, once an agent reaches this agent he/she dies of old age.</td>
</tr>
<tr>
<td>07</td>
<td>max_allowed_population</td>
<td>100</td>
<td>The maximum number of agents that can reside at once inside the environment, once crossed agents will be killed randomly using two different strategies. If however the value passed to this hyperparameter is -1 then there would not be a max cap on number of agents residing at one point. Though there is an option to have uncontrolled number of agents at once, we do not recommend this for best results.</td>
</tr>
<tr>
<td>08</td>
<td>kill_type</td>
<td>"difference"</td>
<td>The strategy to use while killing of people randomly after the environment has reached its max cap of population (if there is any). We offer two types of killing - (i) difference method where the number of people killed after max cap is reached is the increased population - max allowed population, which in a way equalizes the value of population at each time step to max allowed population, and (ii) random method where the number of people killed after max cap is chosen randomly. Note:- the values allowed for this hyperparameter are the strings - "difference" and "random" only.</td>
</tr>
<tr>
<td>09</td>
<td>sensory_radius</td>
<td>100</td>
<td>The radius inside which an agent can sense things. So, the default value of 100 means an agent can sense food particles and other agents within a 100 px radius.</td>
</tr>
<tr>
<td>10</td>
<td>decay_rate</td>
<td>23</td>
<td>The rate at which reward decays from initial -4 to a max of -1 when the agent chooses to stay at one place. The default value of 23 means after every 23 ticks of time the reward given to agent for choosing the stay action will increase by 1. A reward is a way for the environment to tell the agent whether the action taken was good or bad.</td>
</tr>
</table>
<p style="text-align: justify;">All of these hyperparameters are set using the params_dic parameter of the PrimaVita initializer which takes in as input a dictionary with key value mappings of hyperparameter names and corresponding values.</p>
<p style="text-align: justify;">Apart from these hyperparameters we have certain parameters for the PrimaVita initializer which you can set:-</p>
<table id="customers">
<tr>
<th>S.No</th>
<th>Parameter</th>
<th>Default Value </th>
<th>Description</th>
<th>Usage</th>
</tr>
<tr>
<td>01</td>
<td>mode</td>
<td>'bot'</td>
<td>The mode in which the training should proceed. There are only two options for this parameter (both are strings) - "bot" and "human". "bot" mode is when you do not want the pygame visualizer to start during training, which is recommended as the pygame visualizer slows down training. "human" mode is when you want to see the visualizer even during training.</td>
<td>Pass as parameter to PrimaVita class. e.g. model = PrimaVita(mode='bot')</td>
</tr>
<tr>
<td>02</td>
<td>log_dir_info</td>
<td>None</td>
<td>This is what gets appended to the name of the log directory Players_Data. The default value of None generates log directory with timestamp (at the beginning of training) after Players_Data. This is used by the hypertune package to generate meaningful log directory names containing the name of hyperparameter and its value. </td>
<td>Pass as parameter to PrimaVita class. e.g. model = PrimaVita(log_dir_info='my_train')</td>
</tr>
</table>
</li>
<li>
<h4 class="section__title">HyperTuner()</h4>
<p style="text-align: justify;">The class for testing different combinations of hyperparameters and selecting the one which best fits the behaviour you wanted to explore in the agents. This offers two searching methods - grid search and randomized search.</p>
<p style="text-align: justify;">The following parameters can be set for this class’ objects:-</p>
<table id="customers">
<tr>
<th>S.No</th>
<th>Parameter</th>
<th>Description</th>
<th>Optional/Mandatory</th>
<th>Default Value</th>
</tr>
<tr>
<td>01</td>
<td>model_class</td>
<td>The name of environment class to test the different hyperparameter values for. For now we only have a single environment - PrimaVita.</td>
<td>Mandatory</td>
<td>N/A</td>
</tr>
<tr>
<td>02</td>
<td>hyperparameters</td>
<td>The name of hyperparameters to be tested passed as a python list.</td>
<td>Mandatory</td>
<td>N/A</td>
</tr>
<tr>
<td>03</td>
<td>values</td>
<td>Values of the hyperparameters to be tested passed sequentially (following the order in which they appear in hyperparameters list). This will be a 2D python list.</td>
<td>Mandatory</td>
<td>N/A</td>
</tr>
<tr>
<td>04</td>
<td>stop_at</td>
<td>Number of logs to be generated after which training will stop, if this is not mentioned the training will continue infinitely.</td>
<td>Mandatory</td>
<td>N/A</td>
</tr>
<tr>
<td>05</td>
<td>randomize_percent</td>
<td>Setting this parameter converts the grid search into randomized search and the value (between 0 and 1) is the percentage of combinations that is chosen randomly for training models.</td>
<td>Optional</td>
<td>1</td>
</tr>
</table>
</li>
</ol>
</section>
<section class="js-section">
<h3 class="section__title" id="highlights">Highlights</h3>
<ol>
<li>
<p style="text-align: justify;">
PyGeneses can be used for researching the various possible behaviours and
trends by artificial agents. The artificial conditions programmatically provided
to study their behaviour shows the result which can parallelly be compared to those of
the real world conditions as the provided conditions are kept as close as possible in
accordance with that of the natural laws.
</p>
</li>
<li>
<p style="text-align: justify;">PyGeneses is a tool to simulate a very primitive life.
It can be used to train, study and analyse a complex artificial species as well but with more
parameters and a more complex structure for the training model.
</p>
</li>
<li>
<p style="text-align: justify;">PyGeneses has been equipped with a dashboard to analyse the
step by step behavior of the agent which is under observation after it gets trained in
the model. This helps in understanding the reasons behind the agent’s particular behavior
in the given circumstances and conditions.
</p>
</li>
<li>
<p style="text-align: justify;">PyGeneses can always be modified and updated to accumulate
the new conditions and circumstances which could be included in the framework and then the
agent’s behaviors could be observed under those conditions as well along with the old
conditions to analyse the behavior changes.
</p>
</li>
</ol>
</section>
</article>
</div>
<!-- <footer class="footer">Scribbler is a free HTML template created exclusively for <a href="https://tympanus.net/codrops/" target="_blank" class="link link--light">Codrops</a>.</footer> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="main.js"></script>
</body>
</html>