我想創建一個神經網絡近似函數(正弦,餘弦,自定義...),但我努力與格式,我不想使用輸入 - 標籤,而是輸入輸出。我該如何改變它? 我下面this tutorial import tensorflow as tf
import random
from math import sin
import numpy as np
n_nodes_hl1 = 500
n_nodes_hl2 =
我將通過實例解釋我的問題: >>> #In this case, I get unwanted result
>>> k = 20685671025767659927959422028/2580360422
>>> k
8.016582043889239e+18
>>> math.floor(k)
8016582043889239040
>>> #I dont want this to
我知道我們可以利用蒙特卡羅方法,通過「扔」點上右上角近似PI並計算其中有多少是圓等內部.. 我想這樣做,對於每函數f,所以我在矩形「扔」 隨機點[A,b]×[0;最大(F)],我如果我的random_point_y測試低於f(random_point_x),然後我將總數除以f以下的點數。 下面是代碼: clear
close all
%Let's define our function f