Пример #1
0
        public BidirectionalCell(BaseRNNCell l_cell, BaseRNNCell r_cell, string output_prefix = "bi_",
                                 RNNParams @params = null) : base("", @params)
        {
            this._output_prefix        = output_prefix;
            this._override_cell_params = @params != null;
            if (this._override_cell_params)
            {
                Debug.Assert(l_cell._own_params != null && r_cell._own_params, "Either specify params for BidirectionalCell or child cells, not both.");
                foreach (var item in this.Params._params)
                {
                    l_cell.Params._params[item.Key] = item.Value;
                    r_cell.Params._params[item.Key] = item.Value;
                }
            }

            foreach (var item in l_cell.Params._params)
            {
                this.Params._params[item.Key] = item.Value;
            }

            foreach (var item in r_cell.Params._params)
            {
                this.Params._params[item.Key] = item.Value;
            }

            this._cells.Add(l_cell);
            this._cells.Add(r_cell);
        }
Пример #2
0
 public ZoneoutCell(BaseRNNCell base_cell, float zoneout_outputs = 0, float zoneout_states = 0) : base(base_cell)
 {
     Debug.Assert(!(base_cell is FusedRNNCell), "FusedRNNCell doesn't support zoneout. Please unfuse first.");
     Debug.Assert(!(base_cell is BidirectionalCell), "BidirectionalCell doesn't support zoneout since it doesn't support step. Please add ZoneoutCell to the cells underneath instead.");
     Debug.Assert(!(base_cell is SequentialRNNCell), "Bidirectional SequentialRNNCell doesn't support zoneout. Please add ZoneoutCell to the cells underneath instead.");
     this.zoneout_outputs = zoneout_outputs;
     this.zoneout_states  = zoneout_states;
     this.prev_output     = null;
 }
Пример #3
0
        public void Add(BaseRNNCell cell)
        {
            this._cells.Add(cell);
            if (this._override_cell_params)
            {
                Debug.Assert(cell._own_params, "Either specify params for SequentialRNNCell or child cells, not both.");
                foreach (var item in this.Params._params)
                {
                    cell.Params._params[item.Key] = item.Value;
                }
            }

            foreach (var item in cell.Params._params)
            {
                this.Params._params[item.Key] = item.Value;
            }
        }
Пример #4
0
 public ModifierCell(BaseRNNCell base_cell) : base("", null)
 {
     base_cell._modified = true;
     this.base_cell      = base_cell;
 }
Пример #5
0
 public ResidualCell(BaseRNNCell base_cell) : base(base_cell)
 {
 }
Пример #6
0
 public ZoneoutCell(BaseRNNCell base_cell, float zoneout_outputs = 0, float zoneout_states = 0) : base(base_cell)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 public ResidualCell(BaseRNNCell base_cell) : base(base_cell)
 {
     throw new NotImplementedException();
 }
Пример #8
0
 public BidirectionalCell(BaseRNNCell l_cell, BaseRNNCell r_cell, string output_prefix = "bi_",
                          RNNParams @params = null) : base("", @params)
 {
     throw new NotImplementedException();
 }
Пример #9
0
 public ModifierCell(BaseRNNCell base_cell) : base("", null)
 {
 }
Пример #10
0
 public void Add(BaseRNNCell cell)
 {
     throw new NotImplementedException();
 }