コード例 #1
0
void
ViewerDisplayScheduler::timelineGoTo(TimeValue time)
{
    ViewerNodePtr isViewer = getOutputNode()->isEffectViewerNode();
    assert(isViewer);
    isViewer->getTimeline()->seekFrame(time, true, isViewer, eTimelineChangeReasonPlaybackSeek);
}
コード例 #2
0
ファイル: Graph.cpp プロジェクト: mitmul/NeuralNetwork
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);
        }
    }
}
コード例 #3
0
void
ViewerDisplayScheduler::processFrame(const ProcessFrameArgsBase& args)
{
    ViewerNodePtr isViewer = getOutputNode()->isEffectViewerNode();
    assert(isViewer);
    processFramesResults(isViewer, args.results);

} // processFrame
コード例 #4
0
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
コード例 #5
0
void
ViewerDisplayScheduler::onRenderStopped(bool /*/aborted*/)
{
    // Refresh all previews in the tree
    NodePtr effect = getOutputNode();
    
    effect->getApp()->refreshAllPreviews();
    
    if ( effect->getApp()->isGuiFrozen() ) {
        getEngine()->s_refreshAllKnobs();
    }
}
コード例 #6
0
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();
}
コード例 #7
0
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);
}
コード例 #8
0
TimeValue
ViewerDisplayScheduler::getLastRenderedTime() const
{
    ViewerNodePtr effect = getOutputNode()->isEffectViewerNode();
    return TimeValue(effect->getLastRenderedTime());
}
コード例 #9
0
TimeValue
ViewerDisplayScheduler::timelineGetTime() const
{
    ViewerNodePtr isViewer = getOutputNode()->isEffectViewerNode();
    return TimeValue(isViewer->getTimeline()->currentFrame());
}