This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function letsEat(amount, bonus) { | |
var total = 0 | |
var currentLeft = amount | |
while(currentLeft >= bonus) { | |
var thisTrunBonus = Math.floor(currentLeft / bonus) | |
var thisTurnEat = thisTrunBonus * bonus | |
total += thisTurnEat | |
currentLeft = currentLeft - thisTurnEat + thisTrunBonus | |
} | |
return total + currentLeft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LogisticModel(BaseModel): | |
"""Logistic model with L2 regularization.""" | |
def create_model(self, model_input, num_classes=10, l2_penalty=1e-8, **unused_params): | |
with slim.arg_scope([slim.conv2d, slim.fully_connected], | |
activation_fn=tf.nn.relu, | |
weights_initializer=tf.truncated_normal_initializer(0.0, 0.01), |