当前位置: 首页 > news >正文

可以做软件的网站有哪些内容吗人力资源公司名称

可以做软件的网站有哪些内容吗,人力资源公司名称,wordpress视频主题下载地址,企业网站建设 优化#x1f3af;要点 #x1f3af;漂移扩散方程计算微分 | #x1f3af;期权无风险套利公式计算微分 | #x1f3af;实现图结构算法微分 | #x1f3af;实现简单正向和反向计算微分 | #x1f3af;实现简单回归分类和生成对抗网络计算微分 | #x1f3af;几何网格计算微分…要点 漂移扩散方程计算微分 | 期权无风险套利公式计算微分 | 实现图结构算法微分 | 实现简单正向和反向计算微分 | 实现简单回归分类和生成对抗网络计算微分 | 几何网格计算微分 Python和C计算微分正反向累积 算法微分在机器学习领域尤为重要。例如它允许人们在神经网络中实现反向传播而无需手动计算导数。 计算微分的基础是复合函数偏导数链式法则提供的微分分解。简单结构如 y f ( g ( h ( x ) ) ) f ( g ( h ( w 0 ) ) ) f ( g ( w 1 ) ) f ( w 2 ) w 3 w 0 x w 1 h ( w 0 ) w 2 g ( w 1 ) w 3 f ( w 2 ) y \begin{aligned} y f(g(h(x)))f\left(g\left(h\left(w_0\right)\right)\right)f\left(g\left(w_1\right)\right)f\left(w_2\right)w_3 \\ w_0 x \\ w_1 h\left(w_0\right) \\ w_2 g\left(w_1\right) \\ w_3 f\left(w_2\right)y \end{aligned} yw0​w1​w2​w3​​f(g(h(x)))f(g(h(w0​)))f(g(w1​))f(w2​)w3​xh(w0​)g(w1​)f(w2​)y​ 由链式法则得出 ∂ y ∂ x ∂ y ∂ w 2 ∂ w 2 ∂ w 1 ∂ w 1 ∂ x ∂ f ( w 2 ) ∂ w 2 ∂ g ( w 1 ) ∂ w 1 ∂ h ( w 0 ) ∂ x \frac{\partial y}{\partial x}\frac{\partial y}{\partial w_2} \frac{\partial w_2}{\partial w_1} \frac{\partial w_1}{\partial x}\frac{\partial f\left(w_2\right)}{\partial w_2} \frac{\partial g\left(w_1\right)}{\partial w_1} \frac{\partial h\left(w_0\right)}{\partial x} ∂x∂y​∂w2​∂y​∂w1​∂w2​​∂x∂w1​​∂w2​∂f(w2​)​∂w1​∂g(w1​)​∂x∂h(w0​)​ 通常存在两种不同的计算微分模式正向累积和反向累积。 正向累积指定从内到外遍历链式法则即首先计算 ∂ w 1 / ∂ x \partial w_1 / \partial x ∂w1​/∂x然后计算 ∂ w 2 / ∂ w 1 \partial w_2 / \partial w_1 ∂w2​/∂w1​最后计算 ∂ y / ∂ w 2 \partial y / \partial w_2 ∂y/∂w2​ 而反向累积是从外到内的遍历首先计算 ∂ y / ∂ w 2 \partial y / \partial w_2 ∂y/∂w2​然后计算 ∂ w 2 / ∂ w 1 \partial w_2 / \partial w_1 ∂w2​/∂w1​最后计算 ∂ w 1 / ∂ x \partial w_1 / \partial x ∂w1​/∂x​。更简洁地说 正向累积计算递归关系 ∂ w i ∂ x ∂ w i ∂ w i − 1 ∂ w i − 1 ∂ x \frac{\partial w_i}{\partial x}\frac{\partial w_i}{\partial w_{i-1}} \frac{\partial w_{i-1}}{\partial x} ∂x∂wi​​∂wi−1​∂wi​​∂x∂wi−1​​ 且 w 3 y w_3y w3​y 反向累积计算递归关系 ∂ y ∂ w i ∂ y ∂ w i 1 ∂ w i 1 ∂ w i \frac{\partial y}{\partial w_i}\frac{\partial y}{\partial w_{i1}} \frac{\partial w_{i1}}{\partial w_i} ∂wi​∂y​∂wi1​∂y​∂wi​∂wi1​​ 且 w 0 x w_0x w0​x 正向累积在一次传递中计算函数和导数但每个仅针对一个独立变量。相关方法调用期望表达式 Z 相对于变量 V 导出。该方法返回一对已求值的函数及其导数。该方法递归遍历表达式树直到到达变量。如果请求相对于此变量的导数则其导数为 1否则为 0。然后求偏函数以及偏导数。 伪代码 tuplefloat,float evaluateAndDerive(Expression Z, Variable V) {if isVariable(Z)if (Z V) return {valueOf(Z), 1};else return {valueOf(Z), 0};else if (Z A B){a, a} evaluateAndDerive(A, V);{b, b} evaluateAndDerive(B, V);return {a b, a b};else if (Z A - B){a, a} evaluateAndDerive(A, V);{b, b} evaluateAndDerive(B, V);return {a - b, a - b};else if (Z A * B){a, a} evaluateAndDerive(A, V);{b, b} evaluateAndDerive(B, V);return {a * b, b * a a * b}; }Python实现正向累积 class ValueAndPartial:def __init__(self, value, partial):self.value valueself.partial partialdef toList(self):return [self.value, self.partial]class Expression:def __add__(self, other):return Plus(self, other)def __mul__(self, other):return Multiply(self, other)class Variable(Expression):def __init__(self, value):self.value valuedef evaluateAndDerive(self, variable):partial 1 if self variable else 0return ValueAndPartial(self.value, partial)class Plus(Expression):def __init__(self, expressionA, expressionB):self.expressionA expressionAself.expressionB expressionBdef evaluateAndDerive(self, variable):valueA, partialA self.expressionA.evaluateAndDerive(variable).toList()valueB, partialB self.expressionB.evaluateAndDerive(variable).toList()return ValueAndPartial(valueA valueB, partialA partialB)class Multiply(Expression):def __init__(self, expressionA, expressionB):self.expressionA expressionAself.expressionB expressionBdef evaluateAndDerive(self, variable):valueA, partialA self.expressionA.evaluateAndDerive(variable).toList()valueB, partialB self.expressionB.evaluateAndDerive(variable).toList()return ValueAndPartial(valueA * valueB, valueB * partialA valueA * partialB)# Example: Finding the partials of z x * (x y) y * y at (x, y) (2, 3) x Variable(2) y Variable(3) z x * (x y) y * y xPartial z.evaluateAndDerive(x).partial yPartial z.evaluateAndDerive(y).partial print(∂z/∂x , xPartial) # Output: ∂z/∂x 7 print(∂z/∂y , yPartial) # Output: ∂z/∂y 8C实现正向累积 #include iostream struct ValueAndPartial { float value, partial; }; struct Variable; struct Expression {virtual ValueAndPartial evaluateAndDerive(Variable *variable) 0; }; struct Variable: public Expression {float value;Variable(float value): value(value) {}ValueAndPartial evaluateAndDerive(Variable *variable) {float partial (this variable) ? 1.0f : 0.0f;return {value, partial};} }; struct Plus: public Expression {Expression *a, *b;Plus(Expression *a, Expression *b): a(a), b(b) {}ValueAndPartial evaluateAndDerive(Variable *variable) {auto [valueA, partialA] a-evaluateAndDerive(variable);auto [valueB, partialB] b-evaluateAndDerive(variable);return {valueA valueB, partialA partialB};} }; struct Multiply: public Expression {Expression *a, *b;Multiply(Expression *a, Expression *b): a(a), b(b) {}ValueAndPartial evaluateAndDerive(Variable *variable) {auto [valueA, partialA] a-evaluateAndDerive(variable);auto [valueB, partialB] b-evaluateAndDerive(variable);return {valueA * valueB, valueB * partialA valueA * partialB};} }; int main () {// Example: Finding the partials of z x * (x y) y * y at (x, y) (2, 3)Variable x(2), y(3);Plus p1(x, y); Multiply m1(x, p1); Multiply m2(y, y); Plus z(m1, m2);float xPartial z.evaluateAndDerive(x).partial;float yPartial z.evaluateAndDerive(y).partial;std::cout ∂z/∂x xPartial , ∂z/∂y yPartial std::endl;// Output: ∂z/∂x 7, ∂z/∂y 8return 0; }反向累积需要两次传递在正向传递中首先评估函数并缓存部分结果。在反向传递中计算偏导数并反向传播先前导出的值。相应的方法调用期望表达式 Z 被导出并以父表达式的导出值为种子。对于顶部表达式 Z 相对于 Z 导出这是 1。该方法递归遍历表达式树直到到达变量并将当前种子值添加到导数表达式。 伪代码 void derive(Expression Z, float seed) {if isVariable(Z)partialDerivativeOf(Z) seed;else if (Z A B)derive(A, seed);derive(B, seed);else if (Z A - B)derive(A, seed);derive(B, -seed);else if (Z A * B)derive(A, valueOf(B) * seed);derive(B, valueOf(A) * seed); }Python实现反向累积 class Expression:def __add__(self, other):return Plus(self, other)def __mul__(self, other):return Multiply(self, other)class Variable(Expression):def __init__(self, value):self.value valueself.partial 0def evaluate(self):passdef derive(self, seed):self.partial seedclass Plus(Expression):def __init__(self, expressionA, expressionB):self.expressionA expressionAself.expressionB expressionBself.value Nonedef evaluate(self):self.expressionA.evaluate()self.expressionB.evaluate()self.value self.expressionA.value self.expressionB.valuedef derive(self, seed):self.expressionA.derive(seed)self.expressionB.derive(seed)class Multiply(Expression):def __init__(self, expressionA, expressionB):self.expressionA expressionAself.expressionB expressionBself.value Nonedef evaluate(self):self.expressionA.evaluate()self.expressionB.evaluate()self.value self.expressionA.value * self.expressionB.valuedef derive(self, seed):self.expressionA.derive(self.expressionB.value * seed)self.expressionB.derive(self.expressionA.value * seed)# Example: Finding the partials of z x * (x y) y * y at (x, y) (2, 3) x Variable(2) y Variable(3) z x * (x y) y * y z.evaluate() print(z , z.value) # Output: z 19 z.derive(1) print(∂z/∂x , x.partial) # Output: ∂z/∂x 7 print(∂z/∂y , y.partial) # Output: ∂z/∂y 8C实现反向累积 #include iostream struct Expression {float value;virtual void evaluate() 0;virtual void derive(float seed) 0; }; struct Variable: public Expression {float partial;Variable(float _value) {value _value;partial 0;}void evaluate() {}void derive(float seed) {partial seed;} }; struct Plus: public Expression {Expression *a, *b;Plus(Expression *a, Expression *b): a(a), b(b) {}void evaluate() {a-evaluate();b-evaluate();value a-value b-value;}void derive(float seed) {a-derive(seed);b-derive(seed);} }; struct Multiply: public Expression {Expression *a, *b;Multiply(Expression *a, Expression *b): a(a), b(b) {}void evaluate() {a-evaluate();b-evaluate();value a-value * b-value;}void derive(float seed) {a-derive(b-value * seed);b-derive(a-value * seed);} }; int main () {// Example: Finding the partials of z x * (x y) y * y at (x, y) (2, 3)Variable x(2), y(3);Plus p1(x, y); Multiply m1(x, p1); Multiply m2(y, y); Plus z(m1, m2);z.evaluate();std::cout z z.value std::endl;// Output: z 19z.derive(1);std::cout ∂z/∂x x.partial , ∂z/∂y y.partial std::endl;// Output: ∂z/∂x 7, ∂z/∂y 8return 0; }参阅一计算思维 参阅二亚图跨际
http://www.hkea.cn/news/14391980/

相关文章:

  • wordpress 门户网站帮客户做ppt什么的在哪个网站
  • 网站开发公司臻动wordpress 函数 应用
  • 关于网站设计的书母婴门户网站模板
  • 用python做网站后台辽宁建设厅网站什么时候换的
  • 网站被封怎么商业网站网址
  • 网站做信息流兰州有做百度网站的吗
  • 衡阳做网站ss0734工商企业信息查询网站
  • 我要自学网网站建设织梦手机网站模板删除不了
  • 家居定制类网站建设柯桥做网站的公司
  • 做网站前产品经理要了解什么兴义哪有做网站
  • 自助wap建站江阴网站制作
  • 免费自学网优化公司排行榜
  • 政务公开网站建设媒体资源
  • 国美网站建设的特点刚刚合肥最新通告
  • wordpress教程 网站标题天津移动网站设计
  • 如何做网站不容易被攻击斗门网站建设
  • 网站建设前期需要干嘛网络销售怎么学
  • 临沂做网站推广的公司西安中交建设集团网站
  • 做网站点击率赚钱做服装在哪个网站找
  • 网站开发合同模板下载海宁营销型网站建设价格
  • 网络组建与应用实训报告seo培训学院
  • 济南便宜企业网站建设费用竹业网站建设
  • 个人网站开发要多久定制西装
  • 网站浮动广告怎么做帝国cms手机网站
  • 长沙网站建设电话html5开发手机网站教程
  • 芒果tv网站建设的目标wordpress 钛媒体
  • 密云区免费网站建设宁波产品网站设计模板
  • 昆明岭蓝网站建设公司装修网站大全
  • 为什么php做不了大网站兴扬汽车网站谁做的
  • 网站设计流程详细步骤个人网站建设开题报告