목록deep learning (9)
:)
TensorFlowBasic Optimization with GradientTapeimport h5pyimport numpy as npimport tensorflow as tfimport matplotlib.pyplot as pltfrom tensorflow.python.framework.ops import EagerTensorfrom tensorflow.python.ops.resource_variable_ops import ResourceVariableimport timetrain_dataset = h5py.File('train데이터 경로', "r")test_dataset = h5py.File('test데이터 경로', "r")x_train = tf.data.Dataset.from_tensor_slice..
OptimizationGradient Descentimport numpy as npimport matplotlib.pyplot as pltimport scipy.ioimport mathimport sklearnimport sklearn.datasetsfrom opt_utils_v1a import load_params_and_grads, initialize_parameters, forward_propagation, backward_propagationfrom opt_utils_v1a import compute_cost, predict, predict_dec, plot_decision_boundary, load_datasetfrom copy import deepcopyfrom testCases import ..
Gradient CheckingPackagesimport numpy as npfrom testCases import *from public_tests import *from gc_utils import sigmoid, relu, dictionary_to_vector, vector_to_dictionary, gradients_to_vector%load_ext autoreload%autoreload 2 Dimensional Gradient Checkingforward propagationdef forward_propagation(x, theta): J = theta * x return Jx, theta = 2, 4J = forward_propagation(x, theta)print ("J..
RegularizationPackages# import packagesimport numpy as npimport matplotlib.pyplot as pltimport sklearnimport sklearn.datasetsimport scipy.iofrom reg_utils import sigmoid, relu, plot_decision_boundary, initialize_parameters, load_2D_dataset, predict_decfrom reg_utils import compute_cost, predict, forward_propagation, backward_propagation, update_parametersfrom testCases import *from public_tests ..
Initialization Packagesimport numpy as npimport matplotlib.pyplot as pltimport sklearnimport sklearn.datasetsfrom public_tests import *from init_utils import sigmoid, relu, compute_loss, forward_propagation, backward_propagationfrom init_utils import update_parameters, predict, load_dataset, plot_decision_boundary, predict_dec%matplotlib inlineplt.rcParams['figure.figsize'] = (7.0, 4.0) # set de..