Giter VIP home page Giter VIP logo

Comments (1)

holyseven avatar holyseven commented on May 22, 2024

Hi @heimao63531

可以的。目前我们的实现是基于paddle1.8的静态图,以smooth_grad为例:

import interpretdl as it
def paddle_model(data):
    import paddle.fluid as fluid
    class_num = 1000
    model = ResNet50()
    logits = model.net(input=image_input, class_dim=class_num)
    probs = fluid.layers.softmax(logits, axis=-1)
    return probs
sg = it.SmoothGradInterpreter(paddle_model, "assets/ResNet50_pretrained")
gradients = sg.interpret(img_path, visual=True, save_path='assets/sg_test.jpg')

只需要在paddle_model函数中提供模型的构建,然后在SmoothGradInterpreter里给出模型参数的位置(上例是用的预训练模型"assets/ResNet50_pretrained")。

预计这个月底我们将全面支持动态图,到时可以直接在paddle_model里载入训练好的参数,会更加方便。

from interpretdl.

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.