void ViewerDisplayScheduler::timelineGoTo(TimeValue time) { ViewerNodePtr isViewer = getOutputNode()->isEffectViewerNode(); assert(isViewer); isViewer->getTimeline()->seekFrame(time, true, isViewer, eTimelineChangeReasonPlaybackSeek); }
void NeuralNetwork::updateAfterEdges(vector<double> &delta, double &total_error) { // 各出力ノード for(int o = 0; o < output_nodes.size(); ++o) { // 誤差を計算 Node output = getOutputNode(o); Node answer = getAnswerNode(o); double error = answer.value - output.value; total_error += error * error; // 微分値 double deriv = output.value * (1.0 - output.value); // 誤差伝搬に使う delta.push_back(error * deriv); // 現在の出力ノードへ伸びてくるエッジ集合 vector<Edge> edges = getAfterEdges(o); for(int i = 0; i < edges.size(); ++i) { Edge e = edges.at(i); // あるエッジ Node m = getMiddleNode(i); // 根元の中間ノード // 修正量の計算 double update = learn_coeff * m.value * error * deriv; // 重みを修正して更新 e.weight += update; setAfterEdge(e); } } }
void ViewerDisplayScheduler::processFrame(const ProcessFrameArgsBase& args) { ViewerNodePtr isViewer = getOutputNode()->isEffectViewerNode(); assert(isViewer); processFramesResults(isViewer, args.results); } // processFrame
ActionRetCodeEnum ViewerDisplayScheduler::createFrameRenderResults(TimeValue time, const std::vector<ViewIdx>& viewsToRender, bool enableRenderStats, RenderFrameResultsContainerPtr* results) { ViewerNodePtr viewer = toViewerNode(getOutputNode()->getEffectInstance()); assert(viewer); return createFrameRenderResultsGeneric(viewer, shared_from_this(), time, true /*isPlayback*/, RotoStrokeItemPtr(), viewsToRender, enableRenderStats, results); } // createFrameRenderResults
void ViewerDisplayScheduler::onRenderStopped(bool /*/aborted*/) { // Refresh all previews in the tree NodePtr effect = getOutputNode(); effect->getApp()->refreshAllPreviews(); if ( effect->getApp()->isGuiFrozen() ) { getEngine()->s_refreshAllKnobs(); } }
void ViewerDisplayScheduler::onRenderFailed(ActionRetCodeEnum status) { // Upon failure clear the viewer to black. The node that failed should have posted a persistent message. if (status == eActionStatusAborted) { // When aborted, do not clear the viewer return; } ViewerNodePtr effect = getOutputNode()->isEffectViewerNode(); effect->disconnectViewer(); }
void ViewerDisplayScheduler::getFrameRangeToRender(TimeValue &first, TimeValue &last) const { ViewerNodePtr isViewer = getOutputNode()->isEffectViewerNode(); ViewerNodePtr leadViewer = isViewer->getApp()->getLastViewerUsingTimeline(); ViewerNodePtr v = leadViewer ? leadViewer : isViewer; assert(v); int left, right; v->getTimelineBounds(&left, &right); first = TimeValue(left); last = TimeValue(right); }
TimeValue ViewerDisplayScheduler::getLastRenderedTime() const { ViewerNodePtr effect = getOutputNode()->isEffectViewerNode(); return TimeValue(effect->getLastRenderedTime()); }
TimeValue ViewerDisplayScheduler::timelineGetTime() const { ViewerNodePtr isViewer = getOutputNode()->isEffectViewerNode(); return TimeValue(isViewer->getTimeline()->currentFrame()); }