Skip to content

Instantly share code, notes, and snippets.

@anilshanbhag
Last active October 19, 2016 19:44
Show Gist options
  • Save anilshanbhag/34262795bd989cf93d10297ea46ba838 to your computer and use it in GitHub Desktop.
Save anilshanbhag/34262795bd989cf93d10297ea46ba838 to your computer and use it in GitHub Desktop.
(a1:vec[float],a0:vec[vec[float]],a2:vec[float]) =>
map(
zip(
a1,
map(
map(
a0,
(b:vec[float]) =>
res(
for(
b,
vecBuilder[float](784),
(vb:vecBuilder[float],i:long,x:float) =>
merge(vb,(x*lookup(a2,i)))
)
)
),
(a:vec[float]) =>
agg(
a,
0.0F,
(cur:float,v:float) =>
(cur+v),
(cur:float,v:float) =>
(cur+v)
)
)
),
(a:{float,float}) =>
(a.0-a.1)
)
@anilshanbhag
Copy link
Author

The shape of input vectors are
a0 [500]
a1 [500,784]
a2 [784]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment