本文整理汇总了Python中__builtin__.False方法的典型用法代码示例。如果您正苦于以下问题:Python __builtin__.False方法的具体用法?Python __builtin__.False怎么用?Python __builtin__.False使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类__builtin__
的用法示例。
在下文中一共展示了__builtin__.False方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_data
# 需要导入模块: import __builtin__ [as 别名]
# 或者: from __builtin__ import False [as 别名]
def get_data(problem, n_train, n_batch):
if problem == 'cifar10':
# Load data
data_train, data_valid = G.misc.data.cifar10(False)
if problem == 'svhn':
# Load data
data_train, data_valid = G.misc.data.svhn(False, True)
elif problem == 'mnist':
# Load data
validset = False
if validset:
data_train, data_valid, data_test = G.misc.data.mnist_binarized(validset, False)
else:
data_train, data_valid = G.misc.data.mnist_binarized(validset, False)
data_train['x'] = data_train['x'].reshape((-1,1,28,28))
data_valid['x'] = data_valid['x'].reshape((-1,1,28,28))
elif problem == 'lfw':
data_train = G.misc.data.lfw(False,True)
data_valid = G.ndict.getRows(data_train, 0, 1000)
data_init = {'x':data_train['x'][:n_batch]}
if n_train > 0:
data_train = G.ndict.getRows(data_train, 0, n_train)
data_valid = G.ndict.getRows(data_valid, 0, n_train)
return data_train, data_valid, data_init
示例2: getJobResult_wait_ForJobProgressCycle
# 需要导入模块: import __builtin__ [as 别名]
# 或者: from __builtin__ import False [as 别名]
def getJobResult_wait_ForJobProgressCycle(jobID, APIAccessKey, BaseURL):
isInCycle = True
cycleCompleteCount = 0
jobStatus = "unset" # "inprogress", "complete", "error_generic", "error_timeout"
numOfCyclesToTry = 1800
while(isInCycle == True):
# get Job Progress value
currentJobProgress = check_JobProgress(jobID, APIAccessKey, BaseURL)
printMe("Current Job Progress: " + str(currentJobProgress) + ". JobID: " + str(jobID))
time.sleep(1)
# Process Job Status
if(currentJobProgress == 100):
jobStatus = "complete"
isInCycle = False
elif(currentJobProgress == -1):
jobStatus = "error_generic"
isInCycle = False
else:
jobStatus = "inprogress"
isInCycle = True
# Should we bail out of this loop?
if(cycleCompleteCount > numOfCyclesToTry):
jobStatus = "error_timeout"
isInCycle = False
cycleCompleteCount += 1
# For long wait times, echo the cycle
if(cycleCompleteCount % 50 == 0):
printMe("Still working.... Cycle: " + str(cycleCompleteCount))
# Process return (did the job fail or succeed..)
printMe("Result of Job Status Cycle: " + str(jobStatus))
if(jobStatus == "complete"):
return True
else:
return False
# attempt to Convert epochTime to ints and then sort