GithubHelp home page GithubHelp logo

Comments (7)

xiaowuhu avatar xiaowuhu commented on August 15, 2024 1

谢谢指出错误,fixing...

from ai-edu.

fancy-mit-cse avatar fancy-mit-cse commented on August 15, 2024

【7.2线性多分类的神经网络实现】思考与练习:

从4个样本的推理结果来看,分类都是正确的,但是只有第一个样本的结果的0.734的概率值处于绝对领先位置,其它几个分类的概率值优势并不明显,这是为什么?如何让其正确分类的概率值的差距更大?

  1. 当样本数据越接近两个分类的分割线时,则该样本位于分割线两侧的分类的概率越接近。
  2. 我的想法是从SoftMax类中的forward函数入手。我们在该函数中为避免计算溢出有如下改进:
    shift_z = z - np.max(z, axis=1, keepdims=True)
    exp_z = np.exp(shift_z)
    a = exp_z / np.sum(exp_z, axis=1, keepdims=True)
    由shift_z<=0,如果对shift_z乘上系数a(a>1),则得到exp_z'=np.power(exp_z,a),对np.power(exp_z,a) / np.sum(np.power(exp_z,a), axis=1, keepdims=True)化简后可推导得到exp_z越大,得到的新概率就越大

from ai-edu.

fancy-mit-cse avatar fancy-mit-cse commented on August 15, 2024

当系数a=1.5时,我得到如下结果:
w= [[-1.16141288 -2.82832541 3.98973829] [ 3.60888522 -2.30797064 -1.30091458]]
b= [[-1.45768655 2.91008039 -1.45239384]]
output= [[0.00903175 0.77403588 0.21693236] [0.22562913 0.12809308 0.64627779] [0.39531895 0.37732049 0.22736056] [0.53449856 0.45238934 0.0131121 ]]

当系数a=2时,得到如下结果:
w= [[-0.99055252 -2.37294419 3.36349671] [ 3.06044087 -1.9448823 -1.11555856]]
b= [[-1.23151125 2.44669232 -1.21518107]]
output= [[0.00531191 0.80002046 0.19466762] [0.2091815 0.11111932 0.67969918] [0.40393934 0.38113192 0.21492873] [0.54796686 0.44374614 0.00828699]]

from ai-edu.

fancy-mit-cse avatar fancy-mit-cse commented on August 15, 2024

【7.3线性多分类原理】思考与练习:

1.我们假设$w_{21} > w_{22} > w_{23}$是否有根据呢?假设$w_{21} > w_{23} > w_{23}$,直线的位置会有所变化吗?
2.最后一张图的三条直线应该相交于一点吗?

  1. (a)当我们分析第一类样本时,将第一类样本与其他样本分开的直线是
    y_{12} = W_{12} \cdot x + B_{12}
    y_{13} = W_{13} \cdot x + B_{13}
    而第一类的蓝色点样本都位于两条直线的上方,即公式18、19
    y > W_{12} \cdot x + B_{12} \tag{18}
    y > W_{13} \cdot x + B_{13} \tag{19}
    再结合公式13、14,可推得w_{21}>w_{22},w_{21}>w_{23}

    (b)第一问的第二部分是写错了吗?

  2. 如果有点p,其(x,y)坐标位于三条分割线围成的三角形中,则该点p不属于三分类中的任何一类。

from ai-edu.

pineappleoOilPrince avatar pineappleoOilPrince commented on August 15, 2024

07.1-多分类函数中第22个公式的推导的倒数第二步应该是-e^zi/E*e^zj/E,你写成两个都是j了

from ai-edu.

Livon avatar Livon commented on August 15, 2024

from ai-edu.

xonejyr avatar xonejyr commented on August 15, 2024

from ai-edu.

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.