代码之家  ›  专栏  ›  技术社区  ›  Stupid420

角膜的丢失、测量和评分

  •  1
  • Stupid420  · 技术社区  · 7 年前

    两者有什么区别 loss , metrics scoring 在A楼 keras 模型?它们应该是不同的还是相同的?在一个典型的模型中,我们使用这三种方法 GridSearchCV .

    下面是一个典型回归模型的快照,它使用了这三个模型。

    def create_model():
    
     model = Sequential()
     model.add(Dense(12, input_dim=1587, activation='relu'))
     model.add(Dense(1, activation='sigmoid'))
    
     model.compile(loss='mean_squared_error', optimizer='adam', metrics=['mean_squared_error'])
     return model
    
    model = KerasRegressor(build_fn=create_model, verbose=0)
    batch_size = [10, 20, 40, 60, 80, 100]
    epochs = [10, 50, 100]
    param_grid = dict(batch_size=batch_size, epochs=epochs)
    grid = GridSearchCV(estimator=model,param_grid=param_grid, scoring='r2' n_jobs=-1)
    grid_result = grid.fit(X, Y)
    
    1 回复  |  直到 7 年前
        1
  •  2
  •   Vivek Kumar    7 年前

     model.compile(loss='mean_squared_error', 
                   optimizer='adam', 
                   metrics=['mean_squared_error'])
    

    loss Compilation section of the documentation here

    optimizer

    metrics documentation

    scoring the documentation

    param_grid score

    推荐文章