Module: CNTK::Layers
- Defined in:
- lib/cntk/layers.rb
Class Method Summary collapse
Class Method Details
.dense(output_shape, init: Initializer.glorot_uniform, input_shape: [CNTK::NDShape::InferredDimension], use_bias: true, init_bias: 0, name: "") ⇒ Function
7 8 9 10 11 12 13 14 |
# File 'lib/cntk/layers.rb', line 7 def dense(output_shape, init: Initializer.glorot_uniform, input_shape: [CNTK::NDShape::InferredDimension], use_bias: true, init_bias: 0, name: "") _W = Ops.parameter(shape: input_shape + output_shape, init: init, name: "W") b = Ops.parameter(shape: output_shape, init: init_bias, name: "b") x = Ops.placeholder_variable(name: "x") Ops.times(x, _W, output_rank: output_shape.size, infer_input_rank_to_map: 0) + b end |