View code.go
// cosineTracker is a splitTracker for CosineAlgorithm.
type cosineTracker struct {
mseTracker
}
func (c *cosineTracker) Quality() float64 {
sums := []smallVec{c.sumTracker.leftSum, c.sumTracker.rightSum}
sqSums := []float64{c.leftSquares, c.rightSquares}
counts := []float64{float64(c.leftCount), float64(c.rightCount)}
View main.go
// Test a rolling formula for computing the cosine
// distance between a vector and a repeated mean of chunks
// of that vector.
package main
import (
"fmt"
"math"
"math/rand"
View main.go
// Numerically verify that you should average gradients at
// the leaves in a gradient boosted tree.
package main
import (
"fmt"
"github.com/unixpickle/anydiff"
"github.com/unixpickle/anyvec/anyvec64"
View demos.go
package main
import (
"math/rand"
"runtime"
"time"
"github.com/unixpickle/muniverse"
"github.com/unixpickle/muniverse/chrome"
)
View model.txt
Input(w=2, h=1, d=1)
FC(out=2)
Sigmoid
FC(out=1)
View model.m
function learning_gmm()
data = eruption_data();
% Start two clusters on the outskirts of the data.
mean1 = min(data)';
mean2 = max(data)';
cov1 = cov(data);
cov2 = cov(data);
% Initially, each cluster is equally likely.
View main.go
package main
import (
"fmt"
"math/rand"
"time"
"github.com/unixpickle/anyvec"
"github.com/unixpickle/anyvec/anyvec64"
"github.com/unixpickle/approb"
View inject.js
Object.keys(cr_getC2Runtime()).filter((x) => {
var obj = cr_getC2Runtime()[x];
if ('object' !== typeof obj || !obj) {
return false;
}
var keys = Object.keys(obj);
if (keys.length === 0 || keys.some((x) => x.length > 4)) {
return false;
}
return keys.some((x) => obj[x] && 'undefined' !== typeof obj[x].visible);
View inject.js
Object.keys(cr_getC2Runtime()).filter((x) => {
var obj = cr_getC2Runtime()[x];
if ('object' !== typeof obj || !obj) {
return false;
}
var keys = Object.keys(obj);
if (keys.length === 0 || keys.some((x) => x.length < 6)) {
return false;
}
var first = obj[keys[0]];
View search_key.js
function searchKey(needle, haystack, depth) {
var recur;
recur = (obj, path, res, depth, key) => {
if (key === needle) {
res.push(path);
}
if (depth === 0) {
return;
}
if ('object' === typeof obj && obj !== null) {