DiscreteMRNNLayer::DiscreteMRNNLayer( ComputationGraph& g, const DiscreteMRNNParams& params, bool learnable) : bh_(g.CreateParam(params.bh_, learnable)), h_(g.CreateParam(params.h_, learnable)) { for (size_t i = 0, end = params.whx_.size(); i < end; ++i) { whx_.emplace_back(g.CreateParam(params.whx_[i], learnable)); whh_.emplace_back(g.CreateParam(params.whh_[i], learnable)); } used_vars_.push_back(bh_); used_vars_.push_back(h_); }
Var Hashtable::MakeVarFor(ComputationGraph& g, size_t idx, bool learnable) const { return g.CreateParam(w_[idx], learnable); }