Skip to content

Instantly share code, notes, and snippets.

@winobes
winobes / TestModel.groovy
Created January 3, 2018 17:17
CNN dimension error
package com.ni.dl4j
import org.deeplearning4j.nn.api.Layer
import org.deeplearning4j.nn.modelimport.keras.KerasModelImport
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork
import org.junit.Test
import org.nd4j.linalg.api.ndarray.INDArray
import org.nd4j.linalg.factory.Nd4j
class TestModel {
package com.ni.dl4j
import org.deeplearning4j.nn.modelimport.keras.KerasModelImport
import org.deeplearning4j.nn.graph.ComputationGraph
import org.junit.Test
import org.nd4j.linalg.api.ndarray.INDArray
import org.nd4j.linalg.factory.Nd4j
class TestModel {
@Test
def simplex_points(n):
"""
Generates subtriangles of the 3d 0-1 simplex (tripples of tripples).
`n` is the number of triangles along an edge (so it total it generates a
number of subtriangles equal to the n'th triangular number)
"""
def down(x,y,z):
return (x+1, y, z-1)
def left(x,y,z):
@winobes
winobes / comminique.md
Created January 13, 2015 10:46
DEL Paper

What we said

A model for some set of propositions $\Phi$ (for now assume all propositions take a "fuzzy" truth value in $(0,1)\subseteq\mathbb{R}$) we have a set of worlds $W=(0,1)^{|\Phi|}$ (a hypercube) where the world $w=\langle v_0, v_1,...,v_{|\Phi|}\rangle gives valuation $v_i$ to proposition p_i$.

On top of this we have a plausibility function which may equivallently be though t of as a manifold $f:W\to\mathbb{R}$ or a vector field $f:W\to\mathbb{R}^{|\Phi|}$. By theorem, as long as $f$ satisfies certain conditions (it is a smooth manifold, I think), it follows that each world $w$ has a (possibly unique) intergral pat h. Parametrizing these paths with $T=\mathbb{R}$ (time), we obtain $\Pi:W\times T\t o W$ (or if there are multiple paths allowed $\Pi:W\times T\to Pow(W)$.

import random
"""
Scenario:
- Toss the first coin (q) N times (do not show result)
for each toss:
- If Heads toss coin 1 M times
- Else toss coin 2 M times
- Only the series of tosses are observed
(e.g. (HHHT, HTHT, HHHT, HTTH))
Last week I talked about how I thought Haskell might be useful for
puzzling in Zahira.
This week I show you what I mean.
I'll write this in the literate Haskell style because I think it's fun.
You can get a runable version of today's post
[here](https://gist.githubusercontent.com/winobes/95b050b5960932f5f377/raw/96e167da618986d055091bc86cf57d04281ca24e/Potion.lhs).
Snape's Potion Puzzle
---------------------