蝙蝠侠遥控器pcb_通过蝙蝠侠从Circle到ML:第一部分

蝙蝠侠遥控器pcb

介绍: (Introduction:)

The circle in itself is really pretty, ain’t it? But, with some curiosity, you can go beyond a circle. It doesn’t need any calculus or any advanced concepts, just with our favourite class 10 mathematics and with some beautiful ideas, we can go beyond the circle and even create the Batman Inequation. This article is about creating inequations for whatever shapes we want. In the second part, we will see how we can improve and generalize this framework and derive commonly used functions in Machine Learning.

圆圈本身真的很漂亮,不是吗? 但是,出于好奇,您可以超越圈子。 它不需要任何演算或任何高级概念,只需借助我们最喜欢的10级数学和一些漂亮的想法,我们就可以超越圈子,甚至创造出蝙蝠侠不等式。 本文旨在为我们想要的任何形状创建不等式。 在第二部分中,我们将看到如何改进和概括该框架并派生出机器学习中常用的功能。

Image for post
This is a journey from the curve on the left to the one on the right
这是一条从左侧曲线到右侧曲线的旅程

All visualisations created here are generated in openly available software like Desmos and Geogebra. I suggest the readers go ahead and play with these equations using these tools and explore the beauty by themselves.

此处创建的所有可视化效果都是通过Desmos和Geogebra等可公开获得的软件生成的。 我建议读者继续使用这些工具处理这些方程式,并自己探索美丽。

潜力一圈! (The potential of a Circle!)

The humble circle describes multiple points which lie equidistant from a given centre point. Let’s have a look at our familiar friend in all its forms. When all points lie at a given distance, let’s consider 1 unit, we get a circle. Points with distance less than 1 lie inside the circle and ones with more than 1 lie outside the circle. In 3 dimensions a paraboloid with the equation z=x²+y²–1 forms our circle when it intersects with the XY plane.

虚圆圈描述了与给定中心点等距的多个点。 让我们来看看我们熟悉的各种形式的朋友。 当所有点都位于给定距离上时,考虑1个单位,我们得到一个圆。 距离小于1的点位于圆内,大于1的点位于圆外。 在3维中,等式z =x²+ y²–1的抛物面与XY平面相交时形成我们的圆。

Image for post
Different views of a circle
圆的不同观点

We all know that a circle normally takes the form x²+y²=1. What do you think will happen if we go beyond the power of 2? That’s where the magic lies. Let’s take the values from 2 to 10 and observe what happens.

我们都知道,圆通常采用x²+y²= 1的形式。 如果我们超越2的幂,您认为会发生什么? 那就是魔术所在。 让我们取2到10之间的值,观察会发生什么。

Image for post
Powers going from 3 to 10
力量从3到10

For even powers, we see the circle starts looking like a square and it does become one at infinite power. But why does it do so and especially at even powers? We will first try to understand how the points lying on the curve (x^n+y^n=1) behave and then look into the nature and properties of points within the curve (x^n+y^n<=1).

对于偶数幂,我们看到圆开始看起来像一个正方形,并且在无穷大幂时确实变为一个。 但是,为什么要这样做,尤其是在偶数权力下呢? 我们将首先尝试了解曲线上的点(x ^ n + y ^ n = 1)的行为,然后研究曲线内的点(x ^ n + y ^ n <= 1)的性质和特性。

Let’s understand odd powers first. If the power is odd, and say x is negative, then the result of x^n term is also negative, thus y^n term takes a value greater than 1 so that the sum remains 1. For large powers, the difference of 2 numbers becomes insignificant with an increase in power. Let’s take an example, if x⁵ is -100,000 then the value of y⁵ should be 100,001 to satisfy the equation. But, we are plotting x and y, so the values of x and y which justify the equation are (-10, 10.0000199..). This is extremely close to the line y=-x. This is also applicable for the case with negative y and positive x. Also note that higher the power, smaller is the deviation from y=-x. This cannot be possible with negative y and negative x, and that’s why we don’t see a part of the function in that quadrant. When x and y both are positive, we see something like a part of a square. This is because if x is significantly smaller than 1, like 0.7, then x⁵ becomes very small very fast (0.168 here). Thus y⁵ has to be 1-x⁵ which is 0.832, which means y will be very close to 1 but slightly less (0.9638) here. The same logic applies the other way around. So, for x values away from 1, y takes values near 1 (like a horizontal edge) and for x values near 1, y drops to 0 fast (like a vertical edge). This makes the curve look like a part of the square. This can be seen below:

首先让我们了解奇数幂。 如果幂是奇数,并且说x为负,则x ^ n项的结果也为负,因此y ^ n项的值大于1,因此总和仍为1。对于大幂,差2随着功率的增加,数字变得无关紧要。 让我们举一个例子,如果x⁵是-100,000,那么y⁵的值应该是100,001以满足方程。 但是,我们正在绘制x和y,因此证明该方程式正确的x和y的值为(-10,10.0000199 ..)。 这非常接近线y = -x。 这也适用于具有负y和正x的情况。 还要注意,功率越高,与y = -x的偏差就越小。 对于负y和负x不可能做到这一点,这就是为什么我们在该象限中看不到函数的一部分的原因。 当x和y均为正数时,我们看到的东西类似于正方形的一部分。 这是因为如果x显着小于1,例如0.7,则x⁵很快变得非常小(此处为0.168)。 因此,y⁵必须为1-x⁵,即0.832,这意味着y将非常接近于1,但此处略小于(0.9638)。 相同的逻辑反过来适用。 因此,对于x值远离1,y取接近1的值(如水平边),对于x值接近1,ySwift减小到0(如垂直边)。 这使曲线看起来像正方形的一部分。 可以在下面看到:

Image for post
Demonstrating nature with n=9.
展示自然,n = 9。

Once odd powers are understood, understanding even powers becomes much easier. The case of negative values now doesn’t exist so the entire function looks like a square in all the quadrants. This can be seen below. This is what we will focus on from here onwards.

一旦理解了奇数幂,就更容易理解偶数幂。 现在不存在负值的情况,因此整个函数在所有象限中看起来像一个正方形。 可以在下面看到。 这就是我们将从现在开始关注的重点。

Image for post
Graph for n=10
n = 10的图

Finally, the circle and the square are not at odds with each other and have set their powers even. With the hope that you square up with these ideas and doubts don’t encircle you, we loop back to mathematics without cutting any corners.

最后,圆圈和正方形彼此并不矛盾,甚至设定了它们的力量。 希望您能接受这些想法,而疑惑不会笼罩您,因此我们回头继续进行数学学习,而不用加倍努力。

Wait!!! There is a lot left in the store of mathematics. We also know how to shift coordinates. Subtraction for left and addition for right. So we can not only generate a square, but we can also position it anywhere we want. Not only that, but we can also rescale and thus stretch the square and make into a rectangle. Let’s try it:

等待!!! 数学存储中还有很多东西。 我们也知道如何移动坐标。 左减法,右加法。 因此,我们不仅可以生成一个正方形,而且可以将其放置在所需的任何位置。 不仅如此,我们还可以重新缩放比例,从而拉伸正方形并制成矩形。 让我们尝试一下:

Image for post
View Graph 查看图

By now, some of you familiar with deeper mathematics would be able to see how this is related to ideas in Minkowski Distance and F-norm but we will leave them for the future.

到现在,一些熟悉更深层次的数学的人将能够看到它与Minkowski距离F范式中的思想之间的关系,但是我们将把它们留待将来使用。

超越圈子 (Beyond Circles)

While going beyond circles and rectangles, we have to take a slightly different perspective on these graphs. This time we look from the perspective of inequations for points within the curve which have a sum lesser than 1. If the sum of 2 positive numbers is less than 1 then both the numbers have to be less than 1. Similarly, if there are many such terms, then all of them have to be as small as possible so that the sum never exceeds 1. Even if one of the terms is greater than 1 then the inequality will not hold. Isn’t this very similar to the idea of intersection? Selected points should lie in all sets (i.e. all inequations should give values close to 0) if they are not in even one of the sets then they are not selected (even if one of the terms is greater than 1 then the inequation does not hold true). Thus, the squares made above can be seen as the region of intersection of two terms, x^(2n)<1 and y^(2n)<1 (referred to as trenches for their shape) as shown below. Higher values of n allow the terms to be as small as possible.

在超越圆形和矩形的同时,我们必须对这些图形采取稍微不同的观点。 这次,我们从不等式的角度来看曲线中总和小于1的点。如果2个正数的总和小于1,则两个数都必须小于1。类似地,如果存在许多这样的项,那么所有项都必须尽可能小,以使总和永远不超过1。即使其中一项大于1,也不等式也不成立。 这与十字路口的想法不是很相似吗? 如果选择的点不在所有集合中,则它们应该位于所有集合中(即,所有不等式的值都应接近0),即使它们不在一组集合中,也不会被选中(即使其中一项大于1,则不等式也不成立)真正)。 因此,如下所示,上面制作的正方形可以看作是x ^(2n)<1和y ^(2n)<1的两项的交集区域(其形状称为沟槽)。 n的值越高,项越小。

Image for post
The squares(z = x¹⁰+y¹⁰) as the intersection of 2 trenches made by z=x¹⁰ and z=y¹⁰
平方(z = x +1 + y¹)是由z = x +1和z = y¹构成的两个沟槽的交点

And now we have taken a humongous step. We can make very complex figures which emerge from such intersections and take our designing skills to the next level.

现在,我们迈出了巨大的一步。 我们可以制作出非常复杂的图形,这些图形从这样的交叉点出现,并将我们的设计技能提高到一个新的水平。

Image for post
A diamond as the intersection of diagonal trenches: z = (y-2x)¹⁰+(y+2x)¹⁰
菱形作为对角线沟槽的交点:z =(y-2x)¹+(y + 2x)¹

We can get back our graph by just making z=1:

我们可以通过使z = 1来返回图:

Image for post
View Graph 查看图

Let’s try this strategy on something simple:

让我们尝试一些简单的策略:

Image for post
View Graph 查看图

Remember that the trenches we make have the walls at the following positions: y — f(x)=1 and y — f(x)= -1. This is because all absolute values below 1 tend to zero thus are part of the trench whereas all absolute values greater than one increase very fast thus forming the walls. So we can use the trenches shown below.

请记住,我们制作的沟槽的壁在以下位置:y — f(x)= 1和y — f(x)= -1。 这是因为所有小于1的绝对值都趋于零,因此是沟槽的一部分,而所有大于1的绝对值都非常快地增加,从而形成了壁。 因此,我们可以使用下面显示的沟槽。

Image for post

We are now completely equipped for making the batman symbol and covering more than half of the journey. The strategy is not to just intersect but to also eliminate regions from the curve to carve out the shape. This is done by taking curves one by one and refining them and their positioning to match the shape. In some places, the curves had to be inverted i.e. the region greater than 1 had to be made less than 1 and vice versa. This was done by changing the sign of the power of the curves. Note that this strategy can be applied to many shapes. All these curves have the property of being greater than 1 on one side (away from symbol) and less than 1 on the other (towards symbol). Thus every section has its own curve which is then combined using the sum of large even powers as described earlier.

现在,我们已经完全具备制作蝙蝠侠标志的能力,并且涵盖了整个旅程的一半以上。 该策略不仅要相交,而且还要从曲线中消除区域以雕刻出形状。 这是通过一条一条地绘制曲线并对其进行细化和使其位置与形状匹配来完成的。 在某些地方,曲线必须反转,即大于1的区域必须小于1,反之亦然。 这是通过更改曲线功效的符号来完成的。 注意,该策略可以应用于许多形状。 所有这些曲线的特性是,一侧(远离符号)大于1,而另一侧(朝向符号)小于1。 因此,每个部分都有自己的曲线,然后使用较大的偶数幂之和将其合并,如前所述。

The following expressions were used (selected according to the shape of the curve):

使用以下表达式(根据曲线的形状选择):

  • f1(x,y):(0.5(x-1.16)^(2.8))^(2) +(y+1.6): lower edge of right wing

    f1(x,y):( 0.5(x-1.16)^(2.8))^(2)+(y + 1.6):右翼下边缘
  • f2(x,y):(0.5(x+1.16)^(2.8))^(2) +(y+1.6): lower edge of left wing

    f2(x,y):( 0.5(x + 1.16)^(2.8))^(2)+(y + 1.6):左翼下缘
  • f3(x,y):(0.5(y+1.6))^(8)+(x+3): left edge of left wing

    f3(x,y):( 0.5(y + 1.6))^(8)+(x + 3):左翼的左边缘
  • f4(x,y):(0.5(y+1.6))^(8)+(-x+3): right edge of right wing

    f4(x,y):( 0.5(y + 1.6))^(8)+(-x + 3):右翼的右边缘
  • f5(x,y):y+0.6: upper horizontal line

    f5(x,y):y + 0.6:上水平线
  • f6(x,y):(3(x+0.45))^(14)-y+1: left curve between head and wing

    f6(x,y):( 3(x + 0.45))^(14)-y + 1:头和翼之间的左曲线
  • f7(x,y):(3(x-0.45))^(14)-y+1: right curve between head and wing

    f7(x,y):( 3(x-​​0.45))^(14)-y + 1:头和翼之间的右曲线
  • f8(x,y):e^((3(y-0.1)-258.18((1.9x+0.1)(1.9x-0.1))^(1.6))): forms the head and ears

    f8(x,y):e ^((3(y-0.1)-258.18((1.9x + 0.1)(1.9x-0.1))^(1.6))):形成头和耳朵

When all these curves are combined the following figure is obtained:

将所有这些曲线组合后,可获得下图:

Image for post
Note that there are extra bits on the sides but the original function is intact.
请注意,侧面还有多余的位,但原始功能未损坏。

To remove the extra bits, the function is cleaned by adding another term which gives values close to 0 near the shape we want and values greater than 1 in places we don’t want. This makes the final figure as:

为了删除多余的位,通过添加另一个术语来清理该函数,该术语在所需形状附近给出接近0的值,而在不需要的位置给出大于1的值。 这使得最终数字为:

Image for post
View Graph; What does the first term do? It doesn’t kill our curve, so it simply makes it stronger (by eliminating unwanted parts). 视图图 ; 第一个学期做什么? 它不会杀死我们的曲线,因此只是使其变得更牢固(通过消除不需要的部分)。

We can identify all the parts of the curve individually as seen below:

我们可以分别识别曲线的所有部分,如下所示:

Image for post
All curves of the form f(x,y)=1 shown with the inequation
f(x,y)= 1形式的所有曲线均显示为不等式

结论和下一步 (Conclusion and What’s coming next)

We have just obtained a deep understanding of circles and similar inequations with high even powers. We understood why they behave like the intersection of inequation and mastered this by creating our own batman inequation. Everything’s impossible until somebody does it. Well, the batman equation was created about a decade ago so we tried our hand at Batman Inequation. But, we still had to deal with large powers, had to trim our figure and the process still seemed complex. Part II of this blog will remove all these challenges and simplify everything. It will also explain how these ideas are relevant in machine learning in the form of Softmax(our classification friend), Softplus (well-known activation function), log-sum-exp(commonly used function and father of Softmax) and other related directions.

我们刚刚对圆和具有较高偶数幂的类似不等式有了深刻的了解。 我们了解了为什么他们表现得像不等式的交集,并通过创建自己的蝙蝠侠不等式来掌握它们。 除非有人做,否则一切都是不可能的。 好吧,蝙蝠侠方程式是大约十年前创建的,因此我们尝试了蝙蝠侠不等式。 但是,我们仍然必须处理大国问题,必须精简身材,而且过程似乎仍然很复杂。 本博客的第二部分将消除所有这些挑战并简化一切。 它还将以Softmax(我们的分类伙伴),Softplus(众所周知的激活函数),log-sum-exp(Softmax的常用函数和父)的形式以及其他相关方向说明这些思想在机器学习中的相关性。 。

The math is the heaviest just before the application. And I promise you, the application is coming!

在申请之前,数学是最繁重的。 我向您保证,应用程序即将发布!

翻译自: https://medium.com/@jasdeep.grover100/from-circle-to-ml-via-batman-part-i-51ab4cf2db66

蝙蝠侠遥控器pcb

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值