Skip to content

Commit

Permalink
Minor README update. Bias values for Layer class are initialized to 1…
Browse files Browse the repository at this point in the history
… by default. Added method to randomize bias values. Cocoapods update.
  • Loading branch information
Guled committed Apr 20, 2017
1 parent 4c6e1eb commit c6bfa13
Show file tree
Hide file tree
Showing 15 changed files with 422 additions and 417 deletions.
9 changes: 4 additions & 5 deletions Example/MLKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = QA828EJ48A;
LastSwiftMigration = 0820;
ProvisioningStyle = Automatic;
};
Expand Down Expand Up @@ -379,7 +378,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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";
showEnvVarsInLog = 0;
};
CBF04E3B88BDFD9CA04873B6 /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -394,7 +393,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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";
showEnvVarsInLog = 0;
};
E0D9FAAD7A176A48DE5B1E39 /* [CP] Copy Pods Resources */ = {
Expand Down Expand Up @@ -564,7 +563,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = QA828EJ48A;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = MLKit/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -581,7 +580,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = QA828EJ48A;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = MLKit/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
8 changes: 4 additions & 4 deletions Example/MLKit/GameScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,9 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
// Set the current bird

if let generation = flappyBirdGenerationContainer {
if generation.count > currentFlappy{
if generation.count > currentFlappy {
currentBird = generation[currentFlappy]
}else{
} else {
if let bestBird = maxBird {
currentBird = maxBird
}
Expand All @@ -409,7 +409,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
if generation.count > currentFlappy {
currentBird = generation[currentFlappy]
}
}else{
} else {
currentBird = maxBird
}

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

}

}
}

Expand Down
6 changes: 3 additions & 3 deletions Example/MLKit/GameViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class GameViewController: UIViewController {
brain.addLayer(layer: Layer(size: (6, 12), activationType: .siglog))
brain.addLayer(layer: Layer(size: (12, 1), activationType: .siglog))

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]))
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]))

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]))
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]))

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]))
brain.layers[1].bias = Matrix<Float>(rows: 1, columns: 1, elements: ValueArray<Float>([0.440734]))
Expand All @@ -97,7 +97,7 @@ class GameViewController: UIViewController {
// Set the first generation of Flappy Birds
scene.flappyBirdGenerationContainer = generation1
scene.maxBird = bestBird

// Configure the view.
let skView = self.view as! SKView
skView.showsFPS = false
Expand Down
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- MachineLearningKit (0.1.6):
- MachineLearningKit (0.1.7):
- Upsurge
- Nimble (6.0.1)
- Quick (1.1.0)
Expand All @@ -13,14 +13,14 @@ DEPENDENCIES:

EXTERNAL SOURCES:
MachineLearningKit:
:path: "../"
:path: ../

SPEC CHECKSUMS:
MachineLearningKit: 0402701c501bfee52a2ebf48426a33b47d698dcd
MachineLearningKit: 040457b6d6afce606454c16008b954f3952a0d32
Nimble: 1527fd1bd2b4cf0636251a36bc8ab37e81da8347
Quick: dafc587e21eed9f4cab3249b9f9015b0b7a7f71d
Upsurge: 614412863a3b5470b31636a004654b6ef3a34f47

PODFILE CHECKSUM: 6efa57e13fa4fabb331b61a3a84a43c047bb3113

COCOAPODS: 1.2.1.beta.1
COCOAPODS: 1.2.0
4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/MachineLearningKit.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c6bfa13

Please sign in to comment.