FluxML / FluxJS.jl

I heard you like compile times
Other
42 stars 8 forks source link

maxpool primitive #20

Closed Roboneet closed 6 years ago

Roboneet commented 6 years ago

Depends on Vinyl.jl#3

m = Chain(Conv((2, 2), 3=>1), x->maxpool(x, (2, 2)))
Chain(Conv((2, 2), 3=>1), #1)

produces

let model = (function () {
  let math = dl.ENV.math;
  function waterbuffalo(dove) {
    return math.maxpool(dove, [2, 2], [2, 2], 0);
  };
  function model(chimpanzee) {
    return waterbuffalo(math.add(dl.conv2d(chimpanzee, model.weights[0], [1, 1], 0), model.weights[1]));
  };
  model.weights = [];
  return model;
})();
flux.fetchWeights("model.bson").then((function (ws) {
  return model.weights = ws;
}));
MikeInnes commented 6 years ago

:+1: