-
Notifications
You must be signed in to change notification settings - Fork 0
/
codetest.py
38 lines (29 loc) · 1.02 KB
/
codetest.py
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
import numpy as np
from math import floor
# junk file only for testing codes
# from player import Player
# b1 = [np.zeros((10, 1)), np.zeros((3, 1))]
# b2 = [np.ones((10, 1)), np.ones((3, 1))]
# w1 = [np.zeros((10, 3)), np.zeros((8, 7))]
# w2 = [np.ones((10, 3)), np.ones((8, 7))]
# new_biases1 = []
# new_biases2 = []
# new_weights1 = []
# new_weights2 = []
# for u, v in zip(b1, b2):
# cross_point = floor(u.shape[0] / 2)
# new_biases1.append(np.concatenate((u[0:cross_point], v[cross_point:]), axis=0))
# new_biases2.append(np.concatenate((v[0:cross_point], u[cross_point:]), axis=0))
# for u, v in zip(w1, w2):
# cross_point = floor(u.shape[0] / 2) # cross over from middle of matrix
# new_weights1.append(np.concatenate((u[0:cross_point], v[cross_point:]), axis=0))
# new_weights2.append(np.concatenate((v[0:cross_point], u[cross_point:]), axis=0))
# print(b1)
# print(b2)
# print(w1)
# print(w2)
# print("newwwwwwww")
# print(new_biases1)
# print(new_biases2)
# print(new_weights1)
# print(new_weights2)