本文整理汇总了Python中keras.models.Sequential.model方法的典型用法代码示例。如果您正苦于以下问题:Python Sequential.model方法的具体用法?Python Sequential.model怎么用?Python Sequential.model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类keras.models.Sequential
的用法示例。
在下文中一共展示了Sequential.model方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Sequential
# 需要导入模块: from keras.models import Sequential [as 别名]
# 或者: from keras.models.Sequential import model [as 别名]
Sequential.model = _model_evaluation
rho_regressor = Sequential()
rho_regressor.add(Dense(4, input_dim=n_q_regressors_weights, init='uniform',
activation=ACTIVATION))
rho_regressor.add(
Dense(n_q_regressors_weights, init='uniform', activation='linear'))
rho_regressor.compile(loss='mse', optimizer='rmsprop')
import theano
import theano.tensor as T
theta = T.matrix()
res = rho_regressor.model(theta)
# rho_regressor.fit(None, None)
##########################################
def terminal_evaluation(old_theta, new_theta, tol_theta=1e-2):
if increment_base_termination(old_theta, new_theta, 2, tol_theta):
estimator = LQG_Q()
estimator.omega = new_theta[0]
agent = Algorithm(estimator, state_dim, action_dim,
discrete_actions, mdp.gamma, mdp.horizon)
agent._iteration = 1
initial_states = np.array([[1, 2, 5, 7, 10]]).T
values = evaluation.evaluate_policy(mdp, agent,
initial_states=initial_states)