简体   繁体   English

学习画圆

[英]Learning to draw a circle

Im trying practice deep learning while drawing a circle by using neural network techniques (neuralnet package in R), My inputs are vectors (x,y,r) where x,y = coordinates in a 2d plane, and r = radius. 我尝试使用神经网络技术(R中的神经网络程序包)在画圆的同时练习深度学习。我的输入是向量(x,y,r),其中x,y =二维平面中的坐标,r =半径。

My equation for the model looks like this, Im using one hidden node: 我的模型方程看起来像这样,我使用一个隐藏节点:

circle_model <- neuralnet(formula = radius ~ x + y, data = circle_train)

for predicting the values I am using predicted_radius <- model_results$net.result 用于预测值,我正在使用predicted_radius <- model_results$net.result

The problem is that this model only predicts the radius (one variable output) of a given point and what I want is two varaible output from model with any given center point and radius. 问题在于,该模型仅预测给定点的半径(一个可变输出),而我想要的是来自具有任何给定中心点和半径的模型的两个可变输出。

Thanks 谢谢

Neural networks are used to learn and approximate mathematical functions. 神经网络用于学习和近似数学功能。 If we consider the standard equation of a circle, 如果我们考虑一个圆的标准方程,

x^2 + y^2 = a^2 # a is the radius

You can't represent this equation as a function. 您不能将此方程表示为函数。 You may refer to the mathematical definition of a function. 您可以参考函数的数学定义。 Yes, you can train a model which learns several images of circles and then generates an image of a circle. 是的,您可以训练一个模型,该模型学习多个圆形图像,然后生成一个圆形图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM