neuralnetwork how to choose the best model
I am using nftool to train my data (90 piece of data), and my training algorithm is "Bayesian Regularization" I am going to use different neurons to compare and find which one is the best model. Is there any appropriate step I need to follow? Do I need to retrain again and again until getting the good performance of model for each neurons?
See also questions close to this topic

What is the Matlab code to do a kfold cross validation using the built in functions?
What is the Matlab code to do a kfold cross validation using the built in functions?

Nested Functions with Handles in Matlab R2015a
Task: Debug "main.m" so that for given values of (K,t,s), "Call" can be expressed as a function of 5 parameters:(kappa,theta,delta,vega,rho), namely Call = function(kappa,theta,delta,vega,rho). This expression can be implicit.
Note: main.m is a script, while l.m & c.m are functions. Please run "main.m" only when you compile.
Question: Every time I ran "main.m", errors came out. But I do not know how to fix them. It seems I have problem with function handles. Can someone help me please? Thanks!
Error in @(t)betaa*gamma(alpha1)*symsum(f3,n,0,inf) Error in main (line 52) k = K * A(t) / F;
Here is the code:
main.m
syms kappa theta delta vega rho; % 5 parameters K = 16; % Just for example t = 22; % Just for example s = 10; % Just for example F = 15.4; % Fixed data r = 1.03; % Fixed data t0 = 0.00000000001; % Fixed data g = 1/5; % Fixed data % Define variables using (kappa,theta,delta,vega,rho) % alpha = 2 * kappa / delta^2 + 4; betaa = kappa * theta / delta^2; % matlab has a builtin function called "beta", so I use "betaa" here. C = 1 / sqrt(2 * vega); lambda = 1 / (2 * vega); % Define nested functions A = @(t) betaa * gamma(alpha  1) * symsum(f3,n,0,inf); % A depends on f3; n disappears in A f3 = @(n,t) exp(t * f2) * sqrt(factorial(n) / gamma(n + alpha + 6)) * l(n,alpha,betaa); % f3 depends on f2 and l f2 = @(n) quadgk((1  exp(n * kappa * theta * tau)) * f1,0,inf,'RelTol',1e10); % f2 depends on f1; f2 is an integral of tau % f1 is a function of tau, which disappears in f2 f1 = @(tau) C * rho * (2 + t0)^(g * rho  3) * tau^(g) * exp(lambda * tau * (3 + t0)^(rho)) * (g + lambda * tau * (2 + t0)^(rho)); k = K * A(t) / F; % Define function B B = @(n,s,t) exp((s  t) * f2) * c(n) * l(n,alpha  2,betaa); % Ultimate Goal: express Call implicitly using (kappa,theta,delta,vega,rho) Call = @(K,s,t) exp(r * t) * F / A * symsum(B,n,0,inf);
l.m
function y = l(n,v,x) l(0,v,x) = 1 / sqrt(gamma(v + 1)); l(1,v,x) = (1 + v  x) / sqrt(gamma(v + 2)); for i = 2:n y = (v + 2 * n  1  x) / sqrt(n * (v + n)) * l(n  1,v,x)  sqrt((v + n  1) * (n  1) / (v + n) / n) * l(n  2,v,x); end end
c.m
function y = c(n) c(0) = sqrt(gamma(alpha)) * (betaa / (alpha  1)  k) * gammainc(betaa / k,alpha  1) + (betaa^(alpha  1) / k^(alpha  2)) * exp(betaa / k) / sqrt(gamma(alpha)); c(1) = sqrt(gamma(alpha + 1)) * betaa / alpha / (alpha  1) * gammainc(betaa / k,alpha  1); for i = 2:n y = sqrt(n / (alpha + n  1)) * c(n  1) + betaa^alpha / k^(alpha  1) * l(n  2,alpha,beta / k) * exp(betaa / k) / sqrt(n * (n  1) * (n + alpha  1)); end end

How to copy specific files (.mat) from mutiple folders and subfolders to one specific folder using matlab
I don't have a programming background. but I do have some knowledge it. Comming to the question I am trying to find a way to automate the process of copying mat files from many folders and their sub folders to one folder of my choice. please let me know if there is any way of doing it this will certainly increase my speed of work. Because rite now I am doing it manually but it eats a lot of time. Please let me know if anyone can help. Thanks

Tensorflow RL Trading  Variable clarification?
I have the following function from a book. The subject is about creating an agent for stock market to get the best possible portfolio using reinforcement learning and neural network. In the current_state variable, we get prices from day 1 to 200. In the next_state variable, we get prices from day 2 to 201. However, it sets the share_value variable to the price of the day 202. What might be the reason behind this?
def run_simulation(policy, initial_budget, initial_num_stocks, prices, hist, debug=False): budget = initial_budget num_stocks = initial_num_stocks share_value = 0 transitions = list() for i in range(len(prices)  hist  1): if i % 100 == 0: print('progress {:.2f}%'.format(float(100*i) / (len(prices)  hist  1))) current_state = np.asmatrix(np.hstack((prices[i:i+hist], budget, num_stocks))) current_portfolio = budget + num_stocks * share_value action = policy.select_action(current_state, i) share_value = float(prices[i + hist + 1]) if action == 'Buy' and budget >= share_value: budget = share_value num_stocks += 1 elif action == 'Sell' and num_stocks > 0: budget += share_value num_stocks = 1 else: action = 'Hold' new_portfolio = budget + num_stocks * share_value reward = new_portfolio  current_portfolio next_state = np.asmatrix(np.hstack((prices[i+1:i+hist+1], budget, num_stocks))) transitions.append((current_state, action, reward, next_state)) policy.update_q(current_state, action, reward, next_state) portfolio = budget + num_stocks * share_value if debug: print('${}\t{} shares'.format(budget, num_stocks)) return portfolio

Artificial Inteligence and Human Resources
I´m Trying to create a model with quantitative variables, like Sales per month,etc, and qualitative variables, like customer satisfaction (measured with a likert scale),etc... The ideas are:
 Cross all this data with IQ or evaluations during the initial recruitment process and future performance appraisal. GOAL= Predict future performance
 Cross this with personality traits. GOAL=Predict future performance but using personality traits as mediators or moderators (example: person A sells X but he has Y personality traits, so, we should accept him to be a little under average performance).
 Using a Time Series analyse his performance during a year and study the impact of seminars, or lectures on his results.
Cross all of this with an external variable that influences massively all of this like Economic Growth.
Question 1) Should i consider learn R or Python to develop this model?
Question 2) Should i consider regressions and neural networks?
Question 3) Should i use an Autoregressive Model like ARIMA to evaluate future profits? How can i cross this with a regression model with qualitative variables like customer satisfaction to be more precise?
I´m truly sorry for this extended post, but i think i´m close to something important that could put me on a path to a pHD in Organizational Psychology.
Thank you so much.

definition of caffe.Layer class
When defining a python layer in Caffe like this, there are fields like
voc_dir
,split
,random
, etc, some of them are said to inherit fromcaffe.Layer
class.However where can I find the definition of
caffe.Layer
class? Searched through Caffe's documentation but they provide very little explanation, and didn't find it after looking in several directories in their code base.