Giter VIP home page Giter VIP logo

Comments (4)

bfs18 avatar bfs18 commented on August 26, 2024 2

void reset_rnn_buffer(struct  dnn_model_t *model) {
  nnom_layer_t *layer;
  nnom_rnn_layer_t* cl;
  size_t state_size;
  uint32_t layer_num = 1;
  layer = model->nnom_model->head;
  while (layer)
	{
    if(layer->type == NNOM_RNN) {
//      printf("rnn layer reset %d\n", layer_num);
      cl = (nnom_rnn_layer_t*)(layer);
      state_size = cl->cell->state_size;
      nnom_memset(cl->state_buf, 0, state_size * 2);
    }
    layer = layer->shortcut;
    layer_num += 1;
	}
}

This is a function to reset rnn state. Call this function before running a new sample if you want to reset memory.

from nnom.

xulin-1029 avatar xulin-1029 commented on August 26, 2024

或者说timestep=10s帧长且stateful为true,与timestep=1帧且stateful为true,有区别吗?

from nnom.

majianjia avatar majianjia commented on August 26, 2024

按我的理解,区别主要在训练中的区别。实际使用的时候,不清除state会一直有记忆。
但是量化后的记忆可能会更快地消失。
可能不正确

from nnom.

songdaw avatar songdaw commented on August 26, 2024

训练时是已知数据,可以设置stateful=false,timestep=10s数据一次性输入。
推理时设置stateful=true,一帧帧输入,实测没有问题,量化后误差不大。

from nnom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.