Skip to content

Commit c6bfa13

Browse files
author
Guled
committed
Minor README update. Bias values for Layer class are initialized to 1 by default. Added method to randomize bias values. Cocoapods update.
1 parent 4c6e1eb commit c6bfa13

15 files changed

+422
-417
lines changed

Example/MLKit.xcodeproj/project.pbxproj

+4-5
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@
267267
TargetAttributes = {
268268
607FACCF1AFB9204008FA782 = {
269269
CreatedOnToolsVersion = 6.3.1;
270-
DevelopmentTeam = QA828EJ48A;
271270
LastSwiftMigration = 0820;
272271
ProvisioningStyle = Automatic;
273272
};
@@ -379,7 +378,7 @@
379378
);
380379
runOnlyForDeploymentPostprocessing = 0;
381380
shellPath = /bin/sh;
382-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
381+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
383382
showEnvVarsInLog = 0;
384383
};
385384
CBF04E3B88BDFD9CA04873B6 /* [CP] Check Pods Manifest.lock */ = {
@@ -394,7 +393,7 @@
394393
);
395394
runOnlyForDeploymentPostprocessing = 0;
396395
shellPath = /bin/sh;
397-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
396+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
398397
showEnvVarsInLog = 0;
399398
};
400399
E0D9FAAD7A176A48DE5B1E39 /* [CP] Copy Pods Resources */ = {
@@ -564,7 +563,7 @@
564563
buildSettings = {
565564
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
566565
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
567-
DEVELOPMENT_TEAM = QA828EJ48A;
566+
DEVELOPMENT_TEAM = "";
568567
INFOPLIST_FILE = MLKit/Info.plist;
569568
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
570569
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -581,7 +580,7 @@
581580
buildSettings = {
582581
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
583582
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
584-
DEVELOPMENT_TEAM = QA828EJ48A;
583+
DEVELOPMENT_TEAM = "";
585584
INFOPLIST_FILE = MLKit/Info.plist;
586585
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
587586
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

Example/MLKit/GameScene.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,9 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
393393
// Set the current bird
394394

395395
if let generation = flappyBirdGenerationContainer {
396-
if generation.count > currentFlappy{
396+
if generation.count > currentFlappy {
397397
currentBird = generation[currentFlappy]
398-
}else{
398+
} else {
399399
if let bestBird = maxBird {
400400
currentBird = maxBird
401401
}
@@ -409,7 +409,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
409409
if generation.count > currentFlappy {
410410
currentBird = generation[currentFlappy]
411411
}
412-
}else{
412+
} else {
413413
currentBird = maxBird
414414
}
415415

@@ -521,7 +521,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
521521
bird.physicsBody?.applyImpulse(CGVector(dx: 0, dy: 30))
522522

523523
}
524-
524+
525525
}
526526
}
527527

Example/MLKit/GameViewController.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ class GameViewController: UIViewController {
8181
brain.addLayer(layer: Layer(size: (6, 12), activationType: .siglog))
8282
brain.addLayer(layer: Layer(size: (12, 1), activationType: .siglog))
8383

84-
brain.layers[0].weights = Matrix<Float>(rows: 12, columns: 6, elements: ValueArray<Float>([1.14517, 0.691113, -0.938394, 0.798185, -1.20595, 0.732543, 0.174731, -1.0585,-0.500974,-1.02413,0.841067, -0.530047,-0.336522, -1.68883, -1.47241, 0.907576, 0.71408, 0.646764, -0.331544, 0.141004, 2.42381, 0.0683608, 1.01601, 1.42153, -0.672598, 0.889775, -1.55454, -0.530047, 0.307019, -0.483846, 0.0292488, 0.478605, 0.000960251 , -0.379445, -0.336532, -0.17253, 0.892149, -0.301041, 1.06579, -0.230897, 0.39673, -1.93952, 1.69516, 0.185731, -1.48985, -0.17253, -0.336532, -0.379445, 2.12388, 0.0292488, -0.483846, 0.307019, -1.29687, 0.941488, -1.50857 , -1.47241, 0.594132, 1.69516, 0.185731, -1.48985, -0.17253 , 1.06579, -0.301041, 0.892149, -1.15464, 1.15181,0.000960251, 0.478605, 0.0292488 , -0.483846, 0.307019, -1.29687]))
84+
brain.layers[0].weights = Matrix<Float>(rows: 12, columns: 6, elements: ValueArray<Float>([1.14517, 0.691113, -0.938394, 0.798185, -1.20595, 0.732543, 0.174731, -1.0585, -0.500974, -1.02413, 0.841067, -0.530047, -0.336522, -1.68883, -1.47241, 0.907576, 0.71408, 0.646764, -0.331544, 0.141004, 2.42381, 0.0683608, 1.01601, 1.42153, -0.672598, 0.889775, -1.55454, -0.530047, 0.307019, -0.483846, 0.0292488, 0.478605, 0.000960251, -0.379445, -0.336532, -0.17253, 0.892149, -0.301041, 1.06579, -0.230897, 0.39673, -1.93952, 1.69516, 0.185731, -1.48985, -0.17253, -0.336532, -0.379445, 2.12388, 0.0292488, -0.483846, 0.307019, -1.29687, 0.941488, -1.50857, -1.47241, 0.594132, 1.69516, 0.185731, -1.48985, -0.17253, 1.06579, -0.301041, 0.892149, -1.15464, 1.15181, 0.000960251, 0.478605, 0.0292488, -0.483846, 0.307019, -1.29687]))
8585

86-
brain.layers[1].weights = Matrix<Float>(rows: 1, columns: 12, elements: ValueArray<Float>([1.10186, -1.68883, -0.336522, -2.54774, 0.202769, 1.50816 , -3.25252, 0.830278 , 0.104464, -1.26191, 0.698875, -0.447793]))
86+
brain.layers[1].weights = Matrix<Float>(rows: 1, columns: 12, elements: ValueArray<Float>([1.10186, -1.68883, -0.336522, -2.54774, 0.202769, 1.50816, -3.25252, 0.830278, 0.104464, -1.26191, 0.698875, -0.447793]))
8787

8888
brain.layers[0].bias = Matrix<Float>(rows: 12, columns: 1, elements: ValueArray<Float>([0.941488, -1.50857, -1.47241, 0.594132, -0.189659, 0.804515, -1.60174, 0.741886, -0.811568, 0.0985006, -0.863954, -0.729362]))
8989
brain.layers[1].bias = Matrix<Float>(rows: 1, columns: 1, elements: ValueArray<Float>([0.440734]))
@@ -97,7 +97,7 @@ class GameViewController: UIViewController {
9797
// Set the first generation of Flappy Birds
9898
scene.flappyBirdGenerationContainer = generation1
9999
scene.maxBird = bestBird
100-
100+
101101
// Configure the view.
102102
let skView = self.view as! SKView
103103
skView.showsFPS = false

Example/Podfile.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- MachineLearningKit (0.1.6):
2+
- MachineLearningKit (0.1.7):
33
- Upsurge
44
- Nimble (6.0.1)
55
- Quick (1.1.0)
@@ -13,14 +13,14 @@ DEPENDENCIES:
1313

1414
EXTERNAL SOURCES:
1515
MachineLearningKit:
16-
:path: "../"
16+
:path: ../
1717

1818
SPEC CHECKSUMS:
19-
MachineLearningKit: 0402701c501bfee52a2ebf48426a33b47d698dcd
19+
MachineLearningKit: 040457b6d6afce606454c16008b954f3952a0d32
2020
Nimble: 1527fd1bd2b4cf0636251a36bc8ab37e81da8347
2121
Quick: dafc587e21eed9f4cab3249b9f9015b0b7a7f71d
2222
Upsurge: 614412863a3b5470b31636a004654b6ef3a34f47
2323

2424
PODFILE CHECKSUM: 6efa57e13fa4fabb331b61a3a84a43c047bb3113
2525

26-
COCOAPODS: 1.2.1.beta.1
26+
COCOAPODS: 1.2.0

Example/Pods/Local Podspecs/MachineLearningKit.podspec.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)