This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We set a fixed starting point for random numbers so we get the same results each time | |
import random | |
random.seed(42) | |
# Our learning data | |
x_data = [1, 2, 3, 4, 5] # Input numbers | |
y_data = [2, 4, 6, 8, 10] # Output numbers (each is 2 times the input) | |
# Starting guesses for our formula (y = w*x + b) | |
w = random.random() # This should end up close to 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function merge(dst, src) { | |
var h = dst.$$hashKey; | |
if (!angular.isObject(src) && !angular.isFunction(src)) return; | |
var keys = Object.keys(src); | |
for (var j = 0, jj = keys.length; j < jj; j++) { | |
var key = keys[j]; | |
var src_new = src[key]; | |
if (angular.isObject(src_new)) { |