本文整理匯總了Python中utils.Timer.diff方法的典型用法代碼示例。如果您正苦於以下問題:Python Timer.diff方法的具體用法?Python Timer.diff怎麽用?Python Timer.diff使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utils.Timer
的用法示例。
在下文中一共展示了Timer.diff方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: len
# 需要導入模塊: from utils import Timer [as 別名]
# 或者: from utils.Timer import diff [as 別名]
features_list, features, labels_list, labels = dataset_builder.build_labeled_dataset(texts, labels)
timer.checkin("end_getting_training_data")
config = {
"accuracy_threshold": 0.94,
"n_input": len(features_list),
"n_steps": 1,
"n_layers": 1,
"n_hidden": 150,
"n_classes": len(labels_list)
}
nn = RecurrentNN(config)
nn.learn(features, labels)
timer.checkin("end_training")
logger.info("-"*50)
logger.info("ML :" + timer.diff("end_getting_training_data", "end_training"))
logger.info("Total :" + timer.diff("start_getting_training_data", "end_training"))
timer.checkin("end_training")
logger.info("-"*50)
logger.info("do some testing predictions")
api_tweet_provider = TwitterApiDataProvider(
consumer_key='mUnZ9yDNN2pRwzyqzrkwjQ',
consumer_secret='Ow9pJWZNzmg4TX1zrLxfQFnvBFpBi8CydxeQ3Xu6uM',
access_token='238066404-NDqnqYLV7rNO8QKTRw0hWUxiHqKHa4LyZp5ViKUT',
access_secret='OEjieKwOLdXwSpss1DmNzLyucBfre3oWuKK1JNdD5wwC9')
tweets = api_tweet_provider.read("dreamhost")
features_list, features_matrix, unclassifiable, labels_list = (
dataset_builder.build_dataset(features_list[:-2], tweets))
if len(features_matrix):