English 中文(简体)
wandb - 经营期间获得固定价值
原标题:wandb - Access logged values during runtime

如何在手术结束之前从湿干b中取回gged的价值?

import os
import wandb
wandb.init(project= someproject )


def loss_a():
    # do_stuff and log:
    wandb.log({"loss_a": 1.0})
    
def loss_b():
    # do_stuff and log:
    wandb.log({"loss_b": 2.0})

for epoch in range(2):
    loss_a()
    loss_b()
    
    # somehow retrieve loss_a and loss_b and print them here:
    print(f loss_a={??}, loss_b={??} )

运行完成后,我可以找到<代码>wandb.Api,到run.history。 但似乎在操作之前是最后的,见run.history 。 没有工作。

最佳回答
问题回答

看看源代码,run.history 将只暂时在history._data上保存数据。 如诸位在上所示,该特定线在叫回后即清除了含有这些标志的字典(我猜测与通过服务器向数据相对应)。

作为整体工作,您可以将损失从<代码>loss_a和 loss_b上退回,并同时予以记录。 这实际上使两种损失同时发生:

def loss_a():
   # do_stuff and log:
   return 1.0
    
def loss_b():
   # do_stuff and log:
   return 2.0

for epoch in range(2):
   a = loss_a()
   b = loss_b()
    
   print(f loss_a={a}, loss_b={b} )
   wandb.log({"loss_a": a, "loss_b": b})

这也是把你的法典从wandb删除的一个好办法。





相关问题
Resample Filter of WEKA - How to interpret the result

I am currently strugeling with a machine learning problem whereas I have to deal with great unbalanced data sets. That is, there are six classes ( 1 , 2 ... 6 ). Unfortunately there are e.g. for class ...

How to recognize rectangles in this image?

I have a image with horizontal and vertical lines. In fact, this image is the BBC website converted to horizontal and vertical lines. My problem is that I want to be able to find all the rectangles in ...

Question About Using Weka, the machine learning tool

I m using the explorer feature of Weka for classification. So I have my .arff file, with 2 features of NUMERIC value, and my class is a binary 0 or 1 (eg {0,1}). Sample: @RELATION summary @...

Implementing a linear, binary SVM (support vector machine)

I want to implement a simple SVM classifier, in the case of high-dimensional binary data (text), for which I think a simple linear SVM is best. The reason for implementing it myself is basically that ...

libsvm model file format

According to this FAQ the model format in libsvm should be straightforward. And in fact it is, when I call just svm-train. As an example, the first SV for the a1a dataset is 1 3:1 11:1 14:1 19:1 39:...

Competitive Learning in Neural Networks

I am playing with some neural network simulations. I d like to get two neural networks sharing the input and output nodes (with other nodes being distinct and part of two different routes) to compete. ...

热门标签