epochs = 1000
for epoch in 1:epochs
Flux.train!(loss, Flux.params(model), data, optimizer)
if epoch % 100 == 0
println("Epoch $epoch: Loss =$(loss(x_data', y_data))")
end
end
如果你想在场景中更直观地显示世界坐标系,可以通过编写一个简单的脚本来实现。下面是一个基本的示例脚本,它会在场景中绘制出世界坐标系的三个轴:
using UnityEngine;public class WorldAxesIndicator : MonoBehaviour
{public float length…