简体   繁体   中英

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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