ソースを参照

feat: add random walk sampling

RegMs If 3 年 前
コミット
0e85412ab0
5 ファイル変更2933 行追加79 行削除
  1. 58 53
      gnn.go
  2. 20 15
      main.go
  3. 25 10
      matrix.go
  4. 2810 1
      test.out
  5. 20 0
      vector.go

+ 58 - 53
gnn.go

@@ -8,25 +8,27 @@ import (
 )
 
 const (
-	Input  int     = 1433
-	Hidden int     = 50
-	Output int     = 7
-	Sample int     = 1000
-	Batch  int     = 10
-	RateWo float64 = 0.06
-	RateWi float64 = 0.08
-	RateB  float64 = 0.1
+	Input   int     = 1433
+	Hidden  int     = 64
+	Output  int     = 7
+	Sample  int     = 10000
+	Batch   int     = 5
+	Dropout float64 = 0.5
+	RateWo  float64 = 0.1
+	RateWi  float64 = 0.1
+	RateB   float64 = 0.1
 )
 
 type (
 	Parameter struct {
-		Wo, Wi, B Matrix
+		Wo, Wi, B, A Matrix
 	}
 
 	Layer struct {
 		d       int
 		f       func(Matrix) Matrix
 		p       Parameter
+		D       Vector
 		O, I, E Matrix
 	}
 )
@@ -42,10 +44,8 @@ func ReLU(A Matrix) Matrix {
 
 func Softmax(A Matrix) Matrix {
 	for i := 0; i < A.N(); i++ {
-		max, sum := 0., 0.
-		for j := 0; j < A.M(); j++ {
-			max = math.Max(max, A[i][j])
-		}
+		_, max := A[i].Max()
+		sum := 0.
 		for j := 0; j < A.M(); j++ {
 			A[i][j] = math.Exp(A[i][j] - max)
 			sum += A[i][j]
@@ -57,90 +57,95 @@ func Softmax(A Matrix) Matrix {
 	return A
 }
 
-func GetEmbedding(G Graph, u, k int, l []Layer) Vector {
+func GetEmbedding(G Graph, u, k int, l []Layer, train bool) Matrix {
 	if k == 0 {
-		return G.X[u]
+		l[k].E = MakeMatrix(1, l[k].d).Add(Matrix{G.X[u]})
+		if train && l[k].D != nil {
+			l[k].E.Dropout(l[k].D)
+		}
+		return l[k].E
 	}
 	l[k-1].O, l[k-1].I, l[k].E = MakeMatrix(1, l[k-1].d), MakeMatrix(1, l[k-1].d), MakeMatrix(1, l[k].d)
 	Do, Di := 0, 0
 	for v, w := range G.A[u] {
 		if w == 1 {
-			l[k-1].O.Add(Matrix{GetEmbedding(G, v, k-1, l)})
+			l[k-1].O.Add(GetEmbedding(G, v, k-1, l, train))
 			Do++
 		} else {
-			l[k-1].I.Add(Matrix{GetEmbedding(G, v, k-1, l)})
+			l[k-1].I.Add(GetEmbedding(G, v, k-1, l, train))
 			Di++
 		}
 	}
 	if Do > 0 {
-		l[k].E.Add(Multiply(l[k-1].O.Divide(float64(Do)), l[k].p.Wo))
+		l[k].E.Add(l[k-1].O.Divide(float64(Do)).Multiply(l[k].p.Wo))
 	}
 	if Di > 0 {
-		l[k].E.Add(Multiply(l[k-1].I.Divide(float64(Di)), l[k].p.Wi))
+		l[k].E.Add(l[k-1].I.Divide(float64(Di)).Multiply(l[k].p.Wi))
 	}
-	l[k].E.Add(Multiply(Matrix{GetEmbedding(G, u, k-1, l)}, l[k].p.B))
-	return l[k].f(l[k].E)[0]
+	l[k].E.Add(GetEmbedding(G, u, k-1, l, train).Multiply(l[k].p.B))
+	if train && l[k].D != nil {
+		l[k].E.Dropout(l[k].D)
+	}
+	return l[k].f(l[k].E)
 }
 
-// A += B * C / d
-func StartCalc(wg *sync.WaitGroup, A, B, C Matrix, d float64) {
+// A += B * C
+func StartCalc(wg *sync.WaitGroup, A, B, C Matrix) {
 	wg.Add(1)
 	go func() {
-		A.Add(Multiply(B.Transpose(), C).Divide(d))
+		A.Add(B.Transpose().Multiply(C))
 		wg.Done()
 	}()
 }
 
-// A += B
-func StartRefine(wg *sync.WaitGroup, A, B Matrix) {
+// A += B / c
+func StartRefine(wg *sync.WaitGroup, A, B Matrix, c float64) {
 	wg.Add(1)
 	go func() {
-		A.Add(B)
+		A.Add(B.Divide(c))
 		wg.Done()
 	}()
 }
 
 func Train(G Graph) []Layer {
-	p1 := Parameter{MakeRandomMatrix(Input, Hidden), MakeRandomMatrix(Input, Hidden), MakeRandomMatrix(Input, Hidden)}
-	p2 := Parameter{MakeRandomMatrix(Hidden, Output), MakeRandomMatrix(Hidden, Output), MakeRandomMatrix(Hidden, Output)}
+	p1 := Parameter{MakeRandomMatrix(Input, Hidden), MakeRandomMatrix(Input, Hidden), MakeRandomMatrix(Input, Hidden), MakeRandomMatrix(Input*2, 1)}
+	p2 := Parameter{MakeRandomMatrix(Hidden, Output), MakeRandomMatrix(Hidden, Output), MakeRandomMatrix(Hidden, Output), MakeRandomMatrix(Hidden*2, 1)}
 	l := []Layer{{d: Input}, {d: Hidden, f: ReLU, p: p1}, {d: Output, f: Softmax, p: p2}}
 	for i := 0; i < Sample; i++ {
-		if i%10 == 0 {
+		if i%100 == 0 {
 			fmt.Println("sampling", i)
 		}
 		var wg sync.WaitGroup
+		l[0].D, l[1].D = MakeDropoutVector(Input), MakeDropoutVector(Hidden)
 		DWo2, DWi2, DB2 := MakeMatrix(Hidden, Output), MakeMatrix(Hidden, Output), MakeMatrix(Hidden, Output)
 		DWo1, DWi1, DB1 := MakeMatrix(Input, Hidden), MakeMatrix(Input, Hidden), MakeMatrix(Input, Hidden)
-		for u, j := nodeId[rand.Intn(len(nodeId))], 0; j < Batch; j++ {
-			GetEmbedding(G, u, 2, l)
-			delta := MakeMatrix(1, Output)
-			delta[0][G.L[u]] = 1
-			delta.Sub(l[2].E)
-			StartCalc(&wg, DWo2, l[1].O, delta, float64(Batch)/RateWo)
-			StartCalc(&wg, DWi2, l[1].I, delta, float64(Batch)/RateWi)
-			StartCalc(&wg, DB2, l[1].E, delta, float64(Batch)/RateB)
-			delta = Multiply(delta, l[2].p.B.Transpose())
+		for j := 0; j < Batch; j++ {
+			u := nodeId[rand.Intn(len(nodeId))]
+			GetEmbedding(G, u, 2, l, true)
+			// GCN
+			delta := MakeMatrix(1, Output).Sub(l[2].E)
+			delta[0][G.L[u]] += 1
+			StartCalc(&wg, DWo2, l[1].O, delta)
+			StartCalc(&wg, DWi2, l[1].I, delta)
+			StartCalc(&wg, DB2, l[1].E, delta)
+			delta = delta.Multiply(l[2].p.B.Transpose())
 			for k := 0; k < Hidden; k++ {
 				if l[1].E[0][k] == 0 {
 					delta[0][k] = 0
 				}
 			}
-			StartCalc(&wg, DWo1, l[0].O, delta, float64(Batch)/RateWo)
-			StartCalc(&wg, DWi1, l[0].I, delta, float64(Batch)/RateWi)
-			StartCalc(&wg, DB1, Matrix{G.X[u]}, delta, float64(Batch)/RateB)
-			neighbor := make([]int, 0)
-			for v := range G.A[u] {
-				neighbor = append(neighbor, v)
-			}
-			u = neighbor[rand.Intn(len(neighbor))]
+			StartCalc(&wg, DWo1, l[0].O, delta)
+			StartCalc(&wg, DWi1, l[0].I, delta)
+			StartCalc(&wg, DB1, l[0].E, delta)
+			// GAT
 			wg.Wait()
 		}
-		StartRefine(&wg, l[2].p.Wo, DWo2)
-		StartRefine(&wg, l[2].p.Wi, DWi2)
-		StartRefine(&wg, l[2].p.B, DB2)
-		StartRefine(&wg, l[1].p.Wo, DWo1)
-		StartRefine(&wg, l[1].p.Wi, DWi1)
-		StartRefine(&wg, l[1].p.B, DB1)
+		StartRefine(&wg, l[2].p.Wo, DWo2, float64(Batch)/RateWo)
+		StartRefine(&wg, l[2].p.Wi, DWi2, float64(Batch)/RateWi)
+		StartRefine(&wg, l[2].p.B, DB2, float64(Batch)/RateB)
+		StartRefine(&wg, l[1].p.Wo, DWo1, float64(Batch)/RateWo)
+		StartRefine(&wg, l[1].p.Wi, DWi1, float64(Batch)/RateWi)
+		StartRefine(&wg, l[1].p.B, DB1, float64(Batch)/RateB)
 		wg.Wait()
 	}
 	return l

+ 20 - 15
main.go

@@ -2,12 +2,14 @@ package main
 
 import (
 	"fmt"
+	"math/rand"
 	"os"
 )
 
 const (
-	Node = 2708
-	Edge = 5429
+	Node    int     = 2708
+	Edge    int     = 5429
+	Labeled float64 = 0.05
 )
 
 var (
@@ -36,7 +38,6 @@ func main() {
 		}
 		var u int
 		fmt.Fscan(file, &u)
-		nodeId = append(nodeId, u)
 		V := MakeVector(Input)
 		for j := 0; j < Input; j++ {
 			fmt.Fscan(file, &V[j])
@@ -45,7 +46,12 @@ func main() {
 		fmt.Fscan(file, &label)
 		for j := 0; j < Output; j++ {
 			if labelName[j] == label {
-				G.AddNode(u, V, j)
+				if rand.Float64() < Labeled {
+					G.AddNode(u, V, j)
+					nodeId = append(nodeId, u)
+				} else {
+					G.AddNode(u, V, j+Output)
+				}
 				break
 			}
 		}
@@ -58,23 +64,22 @@ func main() {
 	for i := 0; i < Edge; i++ {
 		var u, v int
 		fmt.Fscan(file, &u, &v)
-		G.AddEdge(u, v)
+		G.AddEdge(v, u)
 	}
 	file.Close()
 	l := Train(G)
-	cnt := 0
+	cnt1, cnt2 := 0, 0
 	for u := range G.X {
-		GetEmbedding(G, u, 2, l)
-		id, max := 0, 0.
-		for i := 0; i < Output; i++ {
-			if l[2].E[0][i] > max {
-				id, max = i, l[2].E[0][i]
-			}
-		}
+		GetEmbedding(G, u, 2, l, false)
+		id, _ := l[2].E[0].Max()
 		fmt.Println(u, id)
 		if G.L[u] == id {
-			cnt++
+			cnt1++
+		}
+		if G.L[u] == id+Output {
+			cnt2++
 		}
 	}
-	fmt.Println(cnt, "/", Node)
+	fmt.Println(cnt1, "/", len(nodeId), ",", cnt2, "/", Node-len(nodeId))
+	fmt.Println(100.*cnt1/len(nodeId), ",", 100.*cnt2/(Node-len(nodeId)))
 }

+ 25 - 10
matrix.go

@@ -60,16 +60,7 @@ func (A Matrix) Sub(B Matrix) Matrix {
 	return A
 }
 
-func (A Matrix) Divide(b float64) Matrix {
-	for i := 0; i < A.N(); i++ {
-		for j := 0; j < A.M(); j++ {
-			A[i][j] /= b
-		}
-	}
-	return A
-}
-
-func Multiply(A, B Matrix) Matrix {
+func (A Matrix) Multiply(B Matrix) Matrix {
 	if A.M() != B.N() {
 		panic("Incompatible Dimensions")
 	}
@@ -87,3 +78,27 @@ func Multiply(A, B Matrix) Matrix {
 	}
 	return C
 }
+
+func (A Matrix) Divide(b float64) Matrix {
+	if b == 1 {
+		return A
+	}
+	for i := 0; i < A.N(); i++ {
+		for j := 0; j < A.M(); j++ {
+			A[i][j] /= b
+		}
+	}
+	return A
+}
+
+func (A Matrix) Dropout(B Vector) Matrix {
+	if A.M() != B.N() {
+		panic("Incompatible Dimensions")
+	}
+	for i := 0; i < A.N(); i++ {
+		for j := 0; j < A.M(); j++ {
+			A[i][j] *= B[j]
+		}
+	}
+	return A
+}

+ 2810 - 1
test.out

@@ -26,4 +26,2813 @@ reading node 2400
 reading node 2500
 reading node 2600
 reading node 2700
-2288 / 2708
+sampling 0
+sampling 100
+sampling 200
+sampling 300
+sampling 400
+sampling 500
+sampling 600
+sampling 700
+sampling 800
+sampling 900
+sampling 1000
+sampling 1100
+sampling 1200
+sampling 1300
+sampling 1400
+sampling 1500
+sampling 1600
+sampling 1700
+sampling 1800
+sampling 1900
+sampling 2000
+sampling 2100
+sampling 2200
+sampling 2300
+sampling 2400
+sampling 2500
+sampling 2600
+sampling 2700
+sampling 2800
+sampling 2900
+sampling 3000
+sampling 3100
+sampling 3200
+sampling 3300
+sampling 3400
+sampling 3500
+sampling 3600
+sampling 3700
+sampling 3800
+sampling 3900
+sampling 4000
+sampling 4100
+sampling 4200
+sampling 4300
+sampling 4400
+sampling 4500
+sampling 4600
+sampling 4700
+sampling 4800
+sampling 4900
+sampling 5000
+sampling 5100
+sampling 5200
+sampling 5300
+sampling 5400
+sampling 5500
+sampling 5600
+sampling 5700
+sampling 5800
+sampling 5900
+sampling 6000
+sampling 6100
+sampling 6200
+sampling 6300
+sampling 6400
+sampling 6500
+sampling 6600
+sampling 6700
+sampling 6800
+sampling 6900
+sampling 7000
+sampling 7100
+sampling 7200
+sampling 7300
+sampling 7400
+sampling 7500
+sampling 7600
+sampling 7700
+sampling 7800
+sampling 7900
+sampling 8000
+sampling 8100
+sampling 8200
+sampling 8300
+sampling 8400
+sampling 8500
+sampling 8600
+sampling 8700
+sampling 8800
+sampling 8900
+sampling 9000
+sampling 9100
+sampling 9200
+sampling 9300
+sampling 9400
+sampling 9500
+sampling 9600
+sampling 9700
+sampling 9800
+sampling 9900
+1131198 1
+45061 3
+132821 1
+95642 0
+1109830 1
+6215 4
+4329 2
+12946 2
+1107062 1
+430329 2
+5064 0
+12558 1
+683355 3
+642930 2
+166420 6
+1129494 1
+95718 3
+80491 2
+50381 3
+126920 3
+375825 6
+1130678 2
+12439 4
+49720 2
+654519 2
+1138970 2
+1138027 5
+1130780 3
+155738 6
+1108570 5
+29492 2
+60682 6
+1129442 3
+82920 1
+683404 3
+38829 0
+1129367 1
+1135122 2
+124064 4
+67633 0
+116084 2
+126926 3
+100197 2
+28278 2
+519353 3
+1109208 3
+634938 1
+1116922 5
+28640 6
+529165 2
+1120858 2
+1104946 6
+1130454 3
+1128997 1
+1140547 2
+854434 6
+35070 5
+577331 1
+27241 6
+27531 2
+263553 2
+119761 6
+38845 0
+211906 6
+656231 0
+1106546 0
+1153860 2
+18811 6
+294126 2
+513189 1
+205196 2
+1124844 2
+74427 2
+90655 2
+643735 6
+1952 0
+653628 2
+1134320 2
+576795 1
+68495 5
+4274 3
+12247 6
+575292 2
+28641 6
+1118302 5
+1122304 2
+1153866 5
+1131420 2
+593209 2
+1103676 3
+636500 2
+1153169 5
+1110531 5
+1128151 2
+4649 6
+1154173 1
+3237 6
+180187 6
+1133008 2
+151430 5
+3932 0
+62718 0
+1117942 4
+1152308 0
+1106052 0
+423816 2
+308003 5
+350373 6
+49482 2
+417017 5
+1135368 2
+66805 1
+1152564 0
+594047 1
+409255 0
+16843 3
+82087 1
+592993 5
+1123576 2
+1153736 2
+6741 0
+1105433 3
+1113926 2
+628459 2
+193742 2
+1131421 2
+65057 3
+595063 2
+40135 2
+1153896 5
+1113438 1
+27631 2
+30895 5
+133550 2
+1133047 5
+1129096 4
+672070 2
+430574 2
+767763 3
+1154500 2
+1949 0
+289780 1
+102406 6
+1117920 6
+219446 2
+12330 3
+6818 6
+360028 6
+23545 2
+1126315 2
+1113995 2
+1107567 6
+1113852 0
+171954 2
+1131223 2
+263498 1
+714289 3
+561789 3
+693143 4
+36131 3
+1152959 2
+302545 4
+9581 3
+684531 2
+1106789 2
+578649 1
+1153724 0
+1153160 5
+308529 0
+606647 1
+188471 4
+51045 3
+675649 2
+431206 2
+576973 2
+1152859 6
+111770 2
+1152673 2
+1105428 2
+1131335 3
+824245 0
+1132461 2
+10177 6
+79809 6
+814836 2
+119956 2
+134315 3
+139738 2
+57119 2
+64319 6
+6910 3
+77438 3
+136766 0
+1107861 5
+74937 2
+199571 2
+81722 1
+6169 3
+27199 6
+8875 0
+20833 2
+646836 1
+1108656 2
+54844 2
+91975 4
+1102400 6
+14083 2
+688849 2
+1107325 2
+449841 5
+42209 6
+6130 2
+709518 2
+682508 3
+1109392 2
+714208 3
+348437 3
+1129778 1
+1128943 1
+1129629 1
+242663 2
+31043 2
+1135750 6
+1136310 3
+779960 2
+1113035 2
+230879 2
+22869 0
+593942 2
+1111265 2
+293271 4
+1113541 2
+1128846 2
+239810 0
+141324 0
+248395 2
+578669 1
+1117786 5
+118559 2
+434 5
+642621 3
+217852 5
+330148 2
+1112723 3
+62607 5
+688361 2
+578306 2
+643069 3
+240321 2
+1110209 6
+230884 2
+263069 2
+1817 5
+1116328 2
+1128982 1
+240791 2
+601561 5
+385067 0
+1127812 2
+1112075 2
+416455 1
+169280 2
+159085 2
+1105148 0
+246618 2
+12211 4
+1022969 0
+25702 2
+155277 2
+17363 6
+238099 0
+646195 3
+83826 2
+57948 6
+340075 2
+51052 3
+892139 2
+103528 0
+13982 2
+1132157 3
+5869 2
+23116 3
+1131607 2
+1106568 2
+58436 0
+1035 1
+284025 2
+390894 3
+1125469 3
+683360 0
+177998 1
+579008 1
+69418 2
+318071 0
+940 0
+1120650 5
+1105344 2
+86923 3
+649731 2
+217115 6
+1123493 5
+60170 2
+75694 4
+689439 2
+8213 0
+626999 2
+583318 2
+40125 3
+463 6
+1128437 6
+131117 2
+107177 6
+686030 2
+27632 2
+642798 2
+1128453 1
+17811 5
+1152162 2
+1115790 2
+62274 3
+948846 2
+307336 4
+191404 1
+184157 3
+19231 2
+123556 2
+126909 3
+30901 4
+1132459 2
+593240 1
+84021 1
+12165 1
+198443 1
+1128975 0
+59626 6
+13136 2
+1127657 5
+86359 1
+39165 3
+1107215 0
+15429 6
+120084 2
+6343 6
+1152896 0
+714879 3
+954315 5
+83746 2
+1106854 2
+1132083 2
+1117348 3
+321004 6
+1105505 2
+763010 2
+66564 2
+72406 2
+68463 5
+309476 6
+578898 2
+1115670 2
+45533 2
+577086 1
+1131301 3
+69296 1
+53942 5
+189577 3
+46452 5
+1131549 0
+578780 1
+85299 2
+1131267 2
+1122580 6
+129896 3
+179706 3
+1105810 0
+990075 0
+1127530 3
+1152358 1
+4553 4
+1129208 6
+272720 0
+14428 0
+23546 5
+323128 6
+445938 3
+12198 2
+277263 5
+1104258 2
+85452 2
+1125597 2
+65212 2
+1106492 6
+1113459 1
+102938 2
+1153064 5
+60169 2
+1102625 5
+1114239 6
+610529 2
+8619 2
+288 6
+116087 5
+1135899 2
+39130 6
+621555 6
+33325 2
+93555 2
+159084 2
+521855 3
+1152740 3
+1133390 5
+18532 2
+1154012 6
+1136422 2
+6935 0
+4983 1
+626531 3
+523574 3
+686532 2
+1131464 2
+255233 0
+643777 6
+1126011 3
+1138619 5
+118436 2
+1033 1
+102939 2
+8872 2
+696342 2
+1107367 4
+270456 3
+58454 0
+1131752 1
+1114336 0
+1153195 2
+573964 1
+229635 1
+644093 3
+1153280 1
+93755 6
+950052 2
+648106 2
+561238 1
+815073 2
+735303 1
+203646 3
+84459 4
+1121603 2
+440815 3
+1128314 1
+654339 2
+1026 1
+593544 1
+1114153 2
+3231 5
+71904 2
+429805 2
+131122 2
+1134865 1
+1102407 2
+51909 5
+1119216 5
+1102646 6
+340078 2
+1153786 3
+193354 2
+1103979 2
+152483 1
+13972 2
+1111733 2
+1131165 2
+6814 3
+1128198 1
+158098 3
+37998 5
+328370 2
+594387 1
+1132486 2
+63915 2
+561610 3
+1131195 2
+40124 2
+95579 4
+9515 6
+1128985 1
+97892 6
+11335 6
+395075 2
+573553 2
+48066 2
+18770 2
+1115375 6
+6151 2
+1153014 3
+1103737 2
+400455 2
+34708 2
+6385 0
+1131277 3
+566653 0
+48764 2
+124828 2
+27249 6
+1120880 2
+220420 0
+169279 3
+13960 0
+575077 1
+1122642 2
+1153275 6
+1114364 2
+262178 2
+1131334 3
+235670 2
+13212 2
+12275 2
+32688 2
+55770 0
+231198 2
+20972 0
+6184 2
+93318 2
+132806 1
+35061 1
+1128839 2
+1129621 2
+72101 2
+1111899 0
+25805 6
+35335 2
+1123188 3
+120817 2
+628751 2
+1117833 6
+1112911 1
+696345 2
+1104449 2
+1688 1
+395553 3
+235683 2
+1136040 2
+1131754 1
+18812 2
+399339 4
+1125492 1
+6784 2
+1109199 1
+631015 2
+1105877 3
+116021 2
+28504 2
+1059953 6
+173863 3
+1123087 2
+1113084 2
+294030 0
+152226 0
+1102364 3
+1127430 1
+292277 3
+189623 2
+16461 2
+400473 2
+423463 3
+193932 2
+148170 1
+243483 3
+263482 5
+675847 2
+466170 0
+66751 4
+20528 4
+7867 0
+35797 2
+157761 6
+1130634 2
+108983 3
+446610 3
+66794 0
+85688 5
+9513 6
+63812 5
+161221 2
+1213 2
+1115959 2
+1152663 2
+643199 1
+1120197 2
+1131374 1
+284023 2
+1122704 2
+91853 0
+1114398 2
+416867 3
+1126350 3
+910 3
+38000 5
+136665 4
+6217 5
+633031 2
+1131116 1
+289085 2
+1106388 6
+18313 4
+22835 2
+83725 0
+395725 2
+178209 5
+134314 3
+617378 3
+503893 1
+1108050 2
+1112650 3
+233106 2
+671269 2
+662279 2
+19621 2
+1116146 0
+851968 2
+656048 0
+149669 2
+202520 3
+753265 6
+1152958 2
+128 4
+1118848 2
+628458 2
+1118332 2
+12350 6
+14090 3
+90470 3
+39131 6
+576725 1
+1118120 2
+1119140 2
+1131348 2
+78511 1
+1118092 1
+1127863 1
+24966 2
+1125393 0
+1105033 5
+397488 1
+459216 2
+87915 3
+7022 2
+1131330 3
+243274 2
+643485 3
+133628 6
+1106330 2
+68505 6
+634904 1
+289885 3
+22386 0
+17208 3
+1131745 2
+212107 3
+1128927 6
+1152569 3
+1131300 3
+593329 1
+574710 2
+8079 6
+70281 2
+592973 1
+709113 2
+177993 1
+1959 0
+593022 0
+259702 1
+153598 2
+1114512 5
+118260 2
+594649 1
+1138968 1
+1123926 6
+30973 6
+137359 2
+561582 3
+1134022 1
+1140289 2
+12631 3
+582139 2
+83847 2
+1128935 6
+1131257 3
+6152 2
+13966 1
+593068 1
+1118347 1
+1102442 5
+4660 2
+227178 2
+2698 2
+6311 5
+13652 2
+189856 3
+96851 2
+58552 2
+41216 2
+643734 2
+1118209 0
+31769 2
+74700 3
+1135589 2
+60560 5
+735311 2
+200630 6
+1154520 2
+81350 2
+33907 1
+31105 2
+1951 0
+248431 1
+28491 4
+672064 2
+604073 2
+1153166 0
+390693 2
+108047 1
+307015 1
+1110947 0
+1116842 6
+20923 0
+1121313 0
+1109957 4
+1154525 5
+23448 2
+54129 1
+1117760 4
+48555 2
+66782 5
+608326 5
+1129015 5
+928873 2
+211875 2
+120013 2
+2665 2
+202639 2
+1121057 3
+341188 4
+853118 2
+1108169 2
+212777 5
+160732 5
+368605 2
+645046 3
+14529 6
+28957 3
+25413 5
+1104749 2
+590022 2
+1129111 2
+145315 2
+64519 2
+1120962 2
+746058 2
+3191 3
+43186 2
+41714 1
+1120170 1
+19697 2
+1116839 0
+74749 6
+1154232 2
+1118546 2
+887 1
+47684 0
+444240 5
+10531 3
+686559 2
+12238 2
+105865 2
+299195 2
+144408 2
+1106103 6
+561809 3
+8696 6
+1108167 6
+245288 5
+116552 1
+397590 5
+28456 3
+1117653 2
+1109873 2
+129287 2
+594025 1
+1135455 2
+4330 2
+1131258 3
+739280 2
+2696 2
+1118245 4
+16470 2
+20920 3
+67415 6
+62676 2
+39890 3
+1110024 0
+18785 6
+1120431 2
+1116594 2
+20592 2
+124734 3
+1114992 2
+552469 6
+7276 2
+334153 3
+424540 3
+1120049 2
+158172 3
+1114629 4
+36620 3
+109323 3
+200480 0
+1120563 0
+112813 0
+1119180 6
+1129021 0
+1129040 5
+72056 2
+18619 6
+94641 1
+1694 1
+1105450 2
+13205 2
+1114526 0
+636098 2
+6334 6
+1131189 3
+137380 2
+1102550 1
+157805 4
+141160 2
+561581 3
+74698 3
+671052 2
+1154233 3
+653441 3
+943 0
+711994 2
+1123756 6
+1107312 3
+642847 5
+286562 3
+110163 0
+11342 4
+136767 6
+87363 1
+55403 5
+399173 0
+630817 2
+103537 3
+1112026 2
+6639 5
+1127541 2
+6125 6
+644448 3
+576257 2
+46431 1
+310530 0
+26850 2
+458439 2
+1113831 1
+1140040 2
+82098 1
+801170 1
+1110494 2
+1128977 0
+51879 0
+6220 2
+18615 5
+1128978 1
+171225 2
+33303 0
+8617 2
+1128319 3
+133567 2
+1132887 3
+6238 2
+1105062 2
+135464 2
+686015 2
+46887 2
+636511 2
+198653 1
+578309 3
+154982 3
+1106547 2
+27895 6
+1152714 2
+1128881 6
+95198 0
+654326 1
+1107418 1
+1127851 5
+158812 2
+24530 2
+1108363 0
+39127 0
+1116181 0
+1138043 2
+1125906 5
+1133196 1
+1103016 2
+502574 0
+6939 5
+1131414 2
+594119 2
+6771 6
+1119751 5
+1114125 4
+1154103 3
+35490 0
+31932 5
+1135746 0
+358894 3
+1118388 0
+1110950 0
+27174 2
+61417 5
+1107136 2
+1135894 2
+3222 6
+36140 2
+1125895 2
+4878 0
+559804 3
+633081 3
+1133930 2
+503877 6
+66556 1
+815096 2
+1107319 6
+1136446 2
+1109017 1
+95588 3
+152227 6
+1113934 2
+194617 3
+446271 3
+1119708 1
+135130 1
+633030 3
+644470 3
+47839 2
+8699 5
+41417 0
+1153853 1
+211432 3
+213279 2
+237376 2
+22564 0
+13656 2
+191222 3
+395547 2
+116790 3
+124952 3
+365294 2
+156977 2
+170798 2
+265203 1
+91852 0
+7296 2
+1107455 4
+1110438 2
+1123239 2
+9586 2
+27535 5
+1125944 6
+616336 2
+628500 4
+1135955 2
+22883 0
+134320 3
+10183 0
+1102873 6
+45188 2
+135766 5
+1246 4
+18815 2
+13195 3
+762980 2
+286513 2
+134060 3
+853115 2
+137849 3
+1120731 4
+28287 4
+58268 2
+1110426 5
+1130927 3
+237521 2
+52515 2
+1121063 2
+1129994 0
+40 0
+1128959 1
+85324 2
+561595 3
+187260 5
+1106236 0
+1953 0
+62417 3
+408885 2
+6196 4
+194223 2
+330208 2
+566488 6
+5600 0
+13885 4
+119712 2
+75318 0
+95594 4
+1114192 2
+13654 2
+102061 2
+101660 5
+15984 3
+578365 2
+1153106 2
+22875 0
+1237 2
+35778 3
+561568 3
+470511 5
+739816 2
+1110546 1
+98693 1
+12182 6
+647408 1
+3085 0
+193918 2
+207395 0
+752684 2
+1135082 2
+1111230 4
+1102567 0
+130 4
+285687 2
+1152917 2
+1135125 2
+1104809 6
+27250 6
+1136110 2
+377303 1
+521183 0
+267003 2
+12197 6
+5966 0
+350362 6
+116553 1
+644427 3
+646286 3
+1152143 2
+3097 0
+136768 5
+1122460 5
+118873 2
+212930 2
+8874 5
+601567 5
+594039 6
+1125993 6
+82664 0
+711598 6
+1153942 2
+1131180 3
+16476 2
+69198 2
+421481 2
+1117184 3
+31336 3
+65650 4
+785678 2
+147870 2
+289945 2
+50337 3
+1120643 1
+384428 2
+4335 2
+137873 3
+416964 2
+1134031 1
+235679 5
+103543 3
+1135137 2
+159897 3
+56119 1
+1103969 5
+273949 2
+37483 2
+645088 6
+1117501 3
+5055 2
+124296 2
+1137466 1
+1154230 2
+34979 2
+46491 6
+608292 2
+1131270 3
+1152421 1
+346243 0
+1132948 2
+1105718 2
+578845 5
+1385 2
+284414 5
+906 2
+227286 2
+648369 2
+592975 6
+1153024 0
+2653 4
+162664 2
+85352 1
+189566 3
+218410 2
+596075 0
+467383 2
+73323 0
+134199 2
+42156 2
+38771 2
+59045 6
+1131305 3
+6224 4
+1122574 2
+503871 2
+1132385 2
+362926 0
+78508 4
+20526 4
+1153287 3
+671293 2
+1116629 2
+576362 2
+28227 4
+272345 0
+684372 2
+1134197 2
+289779 1
+1154169 2
+65653 5
+79817 3
+714260 3
+6213 2
+68224 2
+42847 2
+31353 3
+28447 0
+1153065 1
+89547 6
+3084 0
+3101 0
+1131164 2
+20593 2
+2658 2
+633721 2
+1116835 2
+593248 1
+1112417 2
+1131184 3
+48781 2
+28489 2
+642681 3
+118259 0
+941 0
+15892 0
+1131266 3
+593201 5
+1114864 6
+1114118 2
+1136393 2
+1153897 1
+1136447 2
+1130243 2
+46500 2
+6209 5
+145176 3
+34257 2
+3112 0
+50807 0
+1113742 1
+258259 2
+1110028 6
+95435 3
+137790 3
+293974 3
+82666 0
+335042 2
+22431 5
+1114502 1
+1153943 1
+46501 6
+643221 3
+22874 0
+1132857 3
+354004 3
+1131550 1
+1105394 4
+45605 1
+1129018 1
+1124837 0
+232606 2
+1119742 3
+228992 2
+976334 1
+91038 2
+154047 0
+182093 1
+23258 0
+74921 3
+520471 3
+459213 2
+1137140 2
+110162 0
+1119623 2
+20601 6
+30934 2
+210309 3
+193347 2
+1152307 2
+12638 3
+1136634 2
+180373 2
+153063 3
+35343 2
+9708 6
+43698 3
+591017 5
+141868 0
+633585 3
+1131741 1
+310653 3
+1132706 2
+1114838 2
+1154124 2
+133615 5
+10435 0
+14430 5
+308232 3
+96845 6
+1107385 2
+1152991 3
+45212 2
+103482 1
+100935 1
+75969 2
+1111240 2
+38839 0
+117 6
+7041 2
+175909 0
+16471 2
+3243 5
+1153097 2
+582343 2
+1115677 2
+1140548 2
+646837 1
+1717 2
+46536 2
+72908 5
+950986 2
+1140230 2
+48768 2
+1119505 1
+230300 0
+31349 3
+634902 1
+144330 5
+574462 1
+936 0
+1000012 5
+646289 3
+644363 4
+162075 2
+714748 3
+14431 3
+1152944 2
+3828 0
+8224 2
+1129608 6
+213246 2
+379288 0
+28026 0
+62389 5
+273152 1
+1121398 2
+1154276 2
+683294 3
+73972 0
+262121 4
+1126050 6
+137956 5
+1130856 1
+1152194 2
+133563 2
+503883 1
+1111304 1
+12960 6
+1153728 0
+12210 0
+16008 3
+25181 2
+126867 0
+43165 2
+1128536 6
+634975 1
+24974 3
+44017 0
+6210 3
+1117249 6
+1113182 2
+12195 6
+189774 3
+372862 2
+853150 2
+1107558 3
+645897 3
+662572 2
+1127551 3
+12576 1
+594011 2
+429781 6
+34355 3
+1128291 2
+1104300 3
+650834 2
+14549 0
+97390 1
+58540 4
+33301 0
+5038 6
+18834 1
+650814 2
+191216 6
+1136814 1
+1131230 3
+1132815 2
+820662 2
+189571 3
+11337 6
+194645 4
+1104647 2
+6155 4
+1115471 2
+314459 2
+44121 3
+1102751 5
+287787 1
+56167 0
+1131734 1
+1129570 2
+141596 3
+987188 2
+1120786 6
+644334 3
+1152379 3
+1108834 2
+1104851 6
+1153703 2
+38480 2
+1115886 0
+545647 6
+1154176 1
+192870 2
+1118823 1
+1152394 6
+1138755 1
+270600 2
+1106287 2
+509233 6
+739707 2
+630890 0
+23507 2
+612306 2
+50354 2
+1132434 2
+1130356 2
+1123215 5
+74975 0
+141171 2
+67584 3
+1102794 5
+640617 1
+574009 1
+5069 0
+1153900 2
+57922 0
+1112071 0
+753264 2
+251756 2
+101143 0
+650807 2
+1128204 1
+1153264 5
+67246 2
+23738 5
+1109891 2
+252725 0
+32083 2
+31927 2
+1131360 1
+33013 2
+261040 0
+19045 1
+177115 0
+20857 5
+133553 2
+116512 4
+1128868 2
+1130680 1
+3192 3
+25184 2
+1131565 1
+28485 4
+189708 2
+116545 1
+1153003 1
+31083 6
+15987 3
+38537 3
+103515 1
+662250 2
+37879 3
+214472 2
+178727 1
+1154071 6
+675756 2
+1123093 2
+236759 2
+1108728 5
+97377 5
+1114442 1
+1121739 0
+1103038 6
+1108389 3
+563613 2
+1112574 6
+531348 2
+642593 2
+703953 3
+14807 2
+751408 2
+8961 6
+162080 2
+578645 2
+54132 0
+83461 5
+592830 6
+396412 6
+1102548 6
+1106370 2
+6378 4
+3187 3
+27510 1
+1125258 2
+112378 2
+20179 0
+2654 4
+10981 2
+31489 2
+280876 6
+1130676 6
+1105698 6
+6923 5
+7047 2
+8591 2
+561613 3
+219976 0
+15431 6
+755082 3
+23774 2
+415693 1
+110041 2
+32872 0
+1132864 3
+1131466 3
+192850 6
+350319 2
+142268 3
+593104 6
+28385 2
+77829 0
+1131639 2
+1129243 4
+1110515 0
+6941 2
+44368 1
+28290 2
+595056 4
+1121867 6
+52847 3
+1125082 2
+95225 2
+1140231 2
+300071 3
+118682 2
+1136631 3
+367312 2
+102884 6
+6318 5
+95597 3
+3235 5
+3236 6
+1119004 2
+33412 2
+1130929 3
+1128256 6
+20924 0
+358884 3
+123825 2
+1153889 6
+345340 2
+1105011 2
+256106 2
+28964 3
+1111052 0
+1110000 3
+73162 3
+238401 6
+1103394 0
+1131647 2
+17821 2
+135798 0
+36162 2
+152219 2
+714975 2
+662416 2
+248823 1
+86258 2
+6216 2
+45189 2
+1129798 3
+11148 2
+74821 2
+1116347 6
+32276 2
+1118083 2
+1115701 3
+754594 2
+1128990 0
+1104787 2
+648112 2
+8594 2
+174418 2
+9716 6
+1155073 5
+61312 2
+253762 2
+7272 2
+13658 2
+1118286 6
+1109542 3
+561364 3
+148399 6
+51934 2
+59715 0
+486840 1
+593921 2
+3240 6
+64484 1
+175256 1
+197054 1
+1119471 0
+1131172 2
+108974 3
+1095507 6
+10798 5
+189721 3
+143323 6
+145215 2
+66809 6
+1108551 3
+340299 2
+592996 1
+1131150 2
+589923 2
+232605 0
+231249 1
+14429 3
+562940 5
+1154068 3
+632874 3
+63486 5
+218682 0
+195150 6
+12347 2
+1135345 6
+1116410 0
+118079 2
+179180 2
+579108 1
+617575 2
+1127566 3
+129897 3
+1103985 1
+3217 2
+3223 6
+28254 2
+1125992 0
+48766 1
+31483 3
+1116044 3
+49753 3
+27230 4
+1108209 0
+1132416 2
+117316 0
+648121 2
+167205 2
+131042 2
+77758 2
+504 2
+12169 6
+370366 2
+641976 2
+1106671 2
+25772 2
+1120169 5
+33823 0
+28230 0
+140005 2
+593105 1
+1106112 4
+18832 4
+87482 2
+1108329 4
+573978 1
+294239 6
+51866 5
+1113551 2
+179702 2
+1123867 6
+1130653 0
+133566 2
+49895 5
+78555 2
+1109566 3
+6767 5
+459214 2
+1112099 6
+168332 6
+1103162 6
+733576 2
+100701 0
+1152150 3
+22886 0
+575402 2
+1131471 2
+1134348 2
+70520 4
+28542 3
+645571 3
+12158 6
+38722 6
+1109185 2
+116528 6
+218666 6
+1123553 1
+1956 0
+1111614 0
+286500 1
+577227 1
+1116974 2
+58758 1
+2695 2
+88356 3
+1152904 2
+31863 3
+359067 0
+144212 2
+107252 5
+217139 2
+950305 2
+73146 3
+28487 1
+263279 5
+649739 2
+5959 5
+884094 3
+93320 1
+390896 3
+6917 5
+1120866 2
+1129027 1
+20178 0
+140569 2
+241133 4
+1153091 6
+753070 6
+149139 6
+24476 6
+711527 3
+8865 1
+54550 0
+1121254 3
+647315 1
+1153946 2
+964248 5
+1126012 6
+593813 1
+645084 3
+1106401 3
+23070 3
+613409 3
+77108 2
+154023 2
+45603 2
+911198 2
+428610 3
+65074 3
+75674 2
+20602 6
+7537 2
+33231 3
+155736 2
+400356 3
+75693 4
+1152633 3
+2702 2
+1126037 2
+13208 2
+987197 5
+194609 2
+684972 2
+55801 0
+1133338 1
+1153577 1
+595193 2
+1107355 5
+118435 2
+688824 2
+1114352 2
+976284 2
+1120020 4
+1108258 0
+1105530 2
+1117476 1
+192734 2
+1115166 0
+509315 1
+646357 3
+46547 6
+1133428 2
+36145 6
+8766 5
+104840 2
+1105603 2
+1108841 2
+644843 2
+1106849 2
+18774 3
+594511 2
+1919 3
+1118017 2
+197783 6
+71736 3
+282700 6
+593260 1
+77515 6
+69284 1
+738941 4
+11325 6
+756061 2
+56708 2
+239800 6
+49660 6
+63931 5
+1109439 2
+1154042 3
+29723 3
+714256 3
+1112319 2
+29708 2
+77826 0
+217984 2
+989397 6
+69397 6
+647413 1
+39199 2
+321861 3
+57773 5
+47683 0
+1102761 3
+1110390 3
+81714 0
+568857 1
+578347 2
+1104435 3
+182094 1
+5348 2
+42207 0
+506 5
+632796 3
+672071 2
+1132968 2
+1119654 0
+13193 4
+820661 4
+644361 5
+91581 3
+1107041 0
+1131236 3
+3233 2
+325497 1
+175291 6
+168958 1
+628668 4
+521207 0
+3218 2
+37888 3
+376704 2
+1110256 3
+1119671 3
+215912 2
+641956 2
+39124 6
+294145 5
+264347 2
+28359 6
+144701 1
+6214 4
+42221 6
+411092 5
+643003 3
+20850 6
+5454 2
+368431 5
+853116 2
+189572 3
+1152761 2
+2663 0
+63477 5
+1140543 2
+1136442 2
+1152858 5
+1106630 2
+40886 2
+395540 2
+1114664 2
+642920 2
+66990 2
+18781 0
+1110579 0
+463825 6
+70444 0
+119686 2
+1111978 6
+25791 2
+628667 1
+75691 1
+1129368 1
+949318 2
+27246 2
+6898 2
+682815 1
+120039 6
+60159 2
+561593 3
+66982 2
+52003 6
+1152711 3
+385251 6
+409725 5
+259772 0
+134307 3
+1115291 2
+1063773 2
+1128945 1
+1127619 5
+45052 3
+242637 2
+628815 2
+168410 0
+70441 0
+126868 2
+411005 2
+9559 2
+1107808 2
+1481 0
+28350 4
+175576 5
+28674 0
+1104182 2
+1133846 2
+375605 1
+390922 2
+69392 2
+27606 6
+22563 5
+853155 2
+262108 2
+7419 4
+253971 2
+578646 2
+22229 1
+1123530 1
+260121 2
+139547 2
+10793 0
+562123 2
+1154074 2
+78994 3
+642827 3
+16437 2
+1136791 1
+1105887 5
+521251 0
+1152448 2
+18833 2
+6346 2
+128202 3
+737204 2
+67292 2
+1117219 3
+249421 0
+1133469 2
+56115 0
+1129907 2
+212097 3
+899119 2
+733167 2
+4584 2
+1130637 6
+1153150 5
+27243 6
+226698 2
+126128 3
+1131274 3
+1112194 6
+13686 3
+93273 6
+469504 2
+632935 3
+1139195 1
+85449 2
+644441 3
+37541 5
+1107095 5
+28412 2
+1103315 2
+1153056 1
+148341 3
+1112929 2
+1128369 2
+645870 3
+1120252 3
+17201 3
+72805 2
+1130847 1
+1110768 2
+1153879 3
+562067 3
+49844 2
+519318 2
+1365 2
+52007 2
+1113828 2
+1130931 2
+1105672 0
+63549 3
+33818 4
+6786 6
+522338 0
+189574 2
+62333 2
+80515 2
+1154229 3
+32260 3
+24043 2
+95589 3
+1152277 2
+49811 6
+642894 3
+15670 1
+523010 6
+561674 3
+71336 3
+643695 3
+1103499 2
+310742 3
+1139928 6
+1153148 2
+16485 2
+267824 2
+27530 2
+1104191 1
+56709 2
+1061127 5
+35852 2
+49847 5
+1128227 1
+134128 2
+1125467 2
+56112 0
+228990 2
+43639 3
+101811 2
+1121537 6
+3095 0
+1128856 5
+686061 2
+1131312 3
+594483 5
+17477 2
+1131192 3
+28249 4
+28473 4
+4637 6
+197452 2
+591016 5
+1153899 2
+164885 3
+642641 3
+575795 4
+1108597 3
+1128946 2
+1102850 2
+34315 2
+510715 3
+20180 0
+1133004 2
+5462 2
+152731 2
+40151 2
+10796 4
+917493 2
+1104769 6
+74920 2
+78552 2
+1152179 2
+626530 5
+436796 2
+8832 3
+1131634 2
+1123689 2
+22566 0
+919885 2
+10430 0
+708945 2
+1153877 0
+66596 6
+12337 2
+307656 1
+54131 1
+59798 2
+447224 2
+6775 2
+12199 6
+318187 5
+1113534 2
+6925 2
+644577 3
+325314 2
+205192 2
+143476 3
+139865 2
+1130069 6
+1107140 2
+208345 0
+948147 2
+1120777 3
+80656 2
+975567 2
+27623 2
+195792 1
+50980 0
+16819 3
+1112686 2
+1135358 5
+907845 2
+561611 3
+6782 6
+1118658 6
+447250 2
+567018 2
+134316 3
+1125092 4
+39126 6
+135765 5
+127033 0
+61073 2
+131317 2
+8821 3
+1114184 2
+646900 5
+264556 2
+390889 3
+1152910 6
+1131611 6
+1129683 6
+1134346 2
+3232 6
+1125953 3
+1117618 2
+592826 2
+235678 2
+1116336 2
+646809 1
+241821 2
+1120059 2
+1121569 2
+755217 4
+202522 3
+1114388 2
+63832 5
+70442 1
+1132731 1
+1128531 3
+1139009 4
+163235 2
+1129610 1
+5075 0
+646334 3
+55968 4
+1153031 0
+99030 2
+83449 0
+1107728 3
+28265 0
+1123068 5
+137868 3
+358866 3
+89416 0
+278403 2
+687401 2
+1130080 2
+782486 2
+654177 0
+278394 2
+521252 0
+75972 0
+239829 2
+114308 2
+248425 1
+84020 6
+131318 2
+1120444 0
+521269 3
+1135108 2
+1129835 5
+1114605 2
+6163 2
+1107067 2
+1129518 3
+259126 6
+232860 2
+647447 1
+17488 3
+1152821 2
+949511 2
+64271 0
+1131728 5
+734406 2
+1108175 6
+1131137 5
+1153811 5
+308920 3
+1104999 5
+31097 2
+575331 1
+1131828 0
+1129106 0
+210872 2
+14545 2
+40583 3
+167670 6
+574264 1
+12194 4
+22241 2
+66986 2
+16451 2
+237489 2
+30817 2
+143801 2
+46079 1
+1117049 1
+129558 0
+592986 2
+1109581 2
+28471 5
+190706 1
+1153816 2
+593859 1
+531351 2
+23502 2
+126793 3
+696343 2
+193931 2
+1153891 0
+75983 2
+124224 2
+1152259 3
+101263 4
+1111186 2
+1106298 0
+1118764 6
+1132073 2
+1114777 0
+126912 3
+25794 2
+1152975 2
+1153254 2
+1134056 2
+52784 6
+33904 1
+1153861 2
+210871 1
+35922 3
+1115456 2
+97645 1
+73119 3
+112787 2
+1132285 6
+8703 4
+110164 0
+1113614 2
+14531 0
+47682 1
+13717 5
+114189 2
+103430 2
+289088 2
+368657 2
+1136449 2
+52000 2
+1133028 2
+576691 1
+1125402 6
+1108267 0
+593328 1
+1106418 6
+1153922 2
+7430 1
+1153262 3
+18251 0
+5194 2
+582349 2
+75121 6
+10174 2
+1105116 3
+20942 2
+206259 3
+1127913 1
+22876 0
+28267 5
+6344 3
+117328 0
+593060 2
+1129572 2
+39403 4
+39210 2
+73712 6
+206524 5
+1135115 6
+12359 2
+1123991 6
+62634 5
+1105221 0
+7032 3
+1130567 4
+128540 1
+1105360 3
+949217 2
+40922 6
+11326 6
+606479 0
+47570 0
+187354 5
+118558 2
+1128208 2
+180399 2
+128203 6
+593091 1
+254923 6
+216877 6
+166989 2
+92589 3
+87417 5
+1119295 5
+89308 0
+14062 1
+101662 5
+1119987 0
+141342 1
+1116530 2
+1107572 6
+1131167 3
+695284 1
+35854 3
+1127558 3
+70970 2
+7532 2
+98698 1
+1105531 3
+694759 1
+252715 6
+1105574 2
+1119211 2
+1126503 2
+1132505 2
+1105622 2
+644494 3
+509379 2
+1130586 2
+1121659 3
+566664 0
+66563 1
+160705 2
+594900 1
+1128407 0
+28389 5
+118424 2
+1121459 6
+444191 3
+45599 1
+643597 3
+1103610 2
+129042 0
+1786 2
+608190 1
+95188 0
+568045 6
+63835 2
+315789 2
+1152075 6
+57932 2
+1120019 2
+216878 6
+263486 5
+105057 6
+27543 2
+35905 2
+1120084 2
+1130539 1
+763181 2
+5062 0
+1128201 2
+100961 2
+94639 2
+427606 1
+628766 2
+62347 2
+46470 0
+99023 2
+1116268 6
+78557 2
+1154123 2
+1153784 2
+174425 2
+18536 2
+36167 4
+89335 2
+96847 1
+1105764 2
+49843 5
+1034 1
+1104055 6
+129045 0
+689152 6
+106590 0
+59244 5
+1152436 5
+3229 2
+44455 1
+31479 6
+108962 3
+943087 6
+94416 3
+17476 2
+105856 2
+51049 2
+40605 3
+34961 5
+601462 1
+1128974 1
+353541 2
+7432 4
+1152244 2
+75695 2
+1129369 1
+31055 2
+626574 3
+198866 0
+78549 2
+1153183 6
+1999 4
+645452 3
+648232 2
+1154076 1
+1121176 0
+190697 1
+753047 3
+1154459 1
+1138091 3
+312409 2
+573535 6
+293285 2
+10186 0
+348305 0
+1110998 2
+189655 3
+59772 2
+342802 2
+733534 2
+249858 6
+1152290 6
+101145 0
+15889 0
+28387 0
+11093 2
+1112369 3
+1106764 2
+337766 0
+28336 2
+631052 2
+8581 2
+1131359 1
+1154524 2
+189620 0
+20821 5
+51834 0
+188318 2
+39904 2
+1120211 2
+608191 6
+46476 6
+682666 1
+385572 2
+335733 1
+111866 2
+90888 2
+285675 2
+380341 2
+899085 2
+46468 2
+84695 2
+1997 6
+121792 5
+853114 2
+1153945 1
+195361 4
+1127810 2
+38846 0
+219218 3
+1104495 2
+154134 2
+18777 3
+158614 2
+299197 2
+1152676 0
+17798 6
+1272 5
+117315 1
+107569 3
+10169 6
+696346 2
+51831 2
+1107674 6
+28202 6
+107251 5
+1132922 2
+1130808 6
+127940 2
+270085 0
+1104031 0
+13213 3
+1131149 2
+94229 3
+1105932 0
+1119178 0
+77112 6
+35863 6
+2440 5
+1125909 2
+649730 2
+1112665 2
+48550 2
+38205 1
+181782 1
+112099 0
+66594 5
+134219 0
+96335 2
+221302 0
+114 4
+1116569 2
+62329 2
+27203 6
+108963 0
+16474 2
+817774 2
+1131557 1
+5086 3
+646913 1
+1133010 5
+248119 6
+1110628 3
+1107171 0
+1132406 2
+1106172 4
+1131345 2
+1128430 0
+157401 2
+6539 6
+245955 2
+1119078 6
+180301 3
+1130915 2
+1120713 0
+1126044 2
+430711 0
+15076 2
+34266 2
+1136342 2
+1130657 6
+99025 2
+27514 6
+1132418 2
+1122425 4
+131315 2
+173884 3
+260979 6
+1106406 4
+114966 2
+73327 0
+105899 2
+190698 2
+1125386 2
+8687 5
+787016 1
+101261 2
+578337 2
+41666 5
+567005 2
+1131314 3
+1114222 6
+389715 4
+1117089 2
+94953 2
+184918 2
+166825 0
+646412 2
+3220 6
+1152272 2
+628764 2
+18582 1
+1116397 0
+1071981 0
+219239 6
+141347 1
+1110520 2
+1130600 2
+1131163 2
+1132443 2
+115188 2
+102879 6
+35 2
+645016 2
+6913 3
+593559 5
+23069 2
+1128853 0
+34082 3
+1114331 1
+144679 0
+44514 2
+1128267 6
+4804 6
+37884 3
+1133417 3
+255628 2
+193352 2
+1153101 5
+52835 5
+155158 5
+116081 5
+595157 1
+33895 1
+763009 2
+1955 0
+143676 2
+167656 6
+1105231 2
+1031453 2
+164 6
+58453 6
+646440 3
+1129573 1
+48075 5
+111676 0
+578650 1
+235776 1
+95719 6
+1131719 4
+57764 0
+178718 5
+29738 3
+649944 0
+1112426 2
+13269 6
+582511 4
+50838 2
+1112106 2
+175548 2
+27627 2
+1103031 3
+1107010 6
+643239 3
+40131 2
+41732 2
+523394 3
+2354 2
+593560 3
+627024 2
+28649 4
+156794 3
+399370 2
+387795 1
+1104007 6
+39474 1
+20193 2
+103531 0
+93923 2
+1104379 2
+13917 5
+128383 0
+1130934 3
+358887 3
+1110563 2
+27612 3
+20534 4
+1136397 2
+94713 3
+481073 0
+50336 3
+424 2
+34263 2
+594543 1
+82090 1
+12155 6
+68115 0
+1113739 2
+17242 6
+628888 2
+42848 2
+510718 3
+206371 1
+1152490 2
+1103383 5
+1126029 1
+250566 2
+346292 1
+1128542 2
+1131748 2
+1103960 1
+300806 2
+593210 1
+1050679 1
+20584 4
+18773 3
+1106966 2
+1154251 2
+1111788 5
+137130 0
+1120138 2
+61069 3
+92065 2
+315266 3
+151708 2
+593155 2
+145384 2
+288107 6
+289781 1
+6170 4
+1104261 6
+560936 2
+67245 2
+259701 1
+1132809 0
+1152508 1
+36802 2
+28851 1
+7297 2
+51180 6
+1112767 2
+948299 2
+1129443 2
+13024 2
+1128425 2
+1106771 2
+95586 4
+11339 5
+684986 2
+126927 3
+145134 2
+170338 2
+103529 0
+1130568 2
+86840 6
+28632 6
+459206 5
+32698 3
+1153933 2
+124 / 124 , 1587 / 2584
+100 , 61

+ 20 - 0
vector.go

@@ -18,6 +18,26 @@ func MakeRandomVector(n int) Vector {
 	return V
 }
 
+func MakeDropoutVector(n int) Vector {
+	V := make(Vector, n)
+	for i := 0; i < n; i++ {
+		if rand.Float64() >= Dropout {
+			V[i] = 1 / (1 - Dropout)
+		}
+	}
+	return V
+}
+
 func (V Vector) N() int {
 	return len(V)
 }
+
+func (V Vector) Max() (int, float64) {
+	id, max := 0, V[0]
+	for i := 1; i < V.N(); i++ {
+		if V[i] > max {
+			id, max = i, V[i]
+		}
+	}
+	return id, max
+}