Metadata-Version: 2.5
Name: mutationNN
Version: 0.0.7
Summary: Easy creation and mutation of Neural Networks.
Author-email: userMe <maikmuller199@gmail.com>
License-Expression: GPL-3.0-only
License-File: LICENSE.txt
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown

mutationNN creates a Neural Network and allows you to mutate it.



How to use:



from mutationNN import NN



1. Create a NN

neural\_network = NN(

&#x20;   INPUT\_SIZE = 3,

&#x20;   OUTPUT\_SIZE = 1,

&#x20;   MUTATION\_CHANCE = 0.25, #0.25 is the default setting.

&#x20;   FULLY\_CONNECTED = True #False is the default setting.

)



2.1. The Output of the NN will Change the next Input:



p\_I = \[1, 2, 3]

output = neural\_network.process\_Input(p\_I) #Gives you a List with the Size OUTPUT\_SIZE



2.2. The Output won't Change the next Input:



p\_S\_I = \[

&#x20;   \[1, 2, 3],

&#x20;   \[2, 3, 4],

&#x20;   \[3, 4, 5]

]



output = neural\_network.process\_Static\_Input(p\_S\_I))



3\. Mutate the NN:



neural\_network.mutate(must\_mutate=False)

\# must\_mutate has False as default but can be set to true in order to ensure at least 1 mutation will happen.



4\. Take another NN as template:

neural\_network2 = NN(

&#x20;   INPUT\_SIZE = 3,

&#x20;   OUTPUT\_SIZE = 1,

&#x20;   MUTATION\_CHANCE = 0.25, #0.25 is the default setting.

&#x20;   FULLY\_CONNECTED = True #False is the default setting.

)



neural\_network.copy\_NN(neural\_network2)

\# Will copy the Neurons and Weights of agent\_2 and apply mutate(must\_mutate=True) to the network afterwards.



5\. Save your NN:



neural\_network.save\_NN(path="Here your Path", name="NN") 

\# NN is the Default Name. It is a .json file.


6\. Load your NN:

neural\_network3 = NN(

&#x20;   INPUT\_SIZE = 0,

&#x20;   OUTPUT\_SIZE = 0

)



neural\_network3.load\_NN(path="Here your Path", name="NN")



\# INPUT\_SIZE/OUTPUT\_SIZE and MUTATION\_CHANCE don't matter since all Information of the Initial
# NN will be overwritten by the loaded NN.

\# NN is the Default Name.

