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
import mlflow | |
# Log parameters (key-value pairs) | |
mlflow.log_param("num_dimensions", 8) | |
mlflow.log_param("regularization", 0.1) | |
# Log a metric; metrics can be updated throughout the run | |
mlflow.log_metric("accuracy", 0.1) | |
... | |
mlflow.log_metric("accuracy", 0.45) |
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
Snippet deleted due to copyright violation |
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
Snippet deleted due to copyright violation |
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
Snippet deleted due to copyright violation |
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
Snippet deleted due to copyright violation |
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
Snippet deleted due to copyright violation |
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
def RosenbrockOpt(optimizer,MAX_EPOCHS = 4000, MAX_STEP = 100): | |
''' | |
returns distance of each step*MAX_STEP w.r.t minimum (1,1) | |
''' | |
x1_data = tf.Variable(initial_value=tf.random_uniform([1], minval=-3, maxval=3,seed=0),name='x1') | |
x2_data = tf.Variable(initial_value=tf.random_uniform([1], minval=-3, maxval=3,seed=1), name='x2') | |
y = tf.add(tf.pow(tf.subtract(1.0, x1_data), 2.0), | |
tf.multiply(100.0, tf.pow(tf.subtract(x2_data, tf.pow(x1_data, 2.0)), 2.0)), 'y') |
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 AddSign(optimizer.Optimizer): | |
"""Implementation of AddSign. | |
See [Bello et. al., 2017](https://arxiv.org/abs/1709.07417) | |
@@__init__ | |
""" | |
def __init__(self, learning_rate=1.001,alpha=0.01,beta=0.5, use_locking=False, name="AddSign"): | |
super(AddSign, self).__init__(use_locking, name) | |
self._lr = learning_rate | |
self._alpha = alpha |
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 PowerSign(optimizer.Optimizer): | |
"""Implementation of PowerSign. | |
See [Bello et. al., 2017](https://arxiv.org/abs/1709.07417) | |
@@__init__ | |
""" | |
def __init__(self, learning_rate=0.001,alpha=0.01,beta=0.5, use_locking=False, name="PowerSign"): | |
super(PowerSign, self).__init__(use_locking, name) | |
self._lr = learning_rate | |
self._alpha = alpha | |
self._beta = beta |
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
# This class defines the API to add Ops to train a model. | |
from tensorflow.python.ops import control_flow_ops | |
from tensorflow.python.ops import math_ops | |
from tensorflow.python.ops import state_ops | |
from tensorflow.python.framework import ops | |
from tensorflow.python.training import optimizer | |
import tensorflow as tf |