Skip to content

Instantly share code, notes, and snippets.

@cacaocake
cacaocake / penguin-problem.js
Last active May 23, 2019 21:32
Penguin Problem
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
@cacaocake
cacaocake / model.py
Created August 20, 2017 05:52
20% 모델
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),