Keshawn_lu's Blog

Keshawn_lu's Blog

Become a better myself.

吴恩达深度学习 C2_W1_Assignment
吴恩达深度学习 C2_W1_Assignment任务1:初始化指定权重Part0:准备数据1234567891011121314import numpy as npimport matplotlib.pyplot as pltimport sklearnimport sklearn.datasetsfrom init_utils import sigmoid, relu, compute_loss, forward_propagation, backward_propagationfrom init_utils import update_parameters, predict, loa...
吴恩达深度学习 C1_W4_Assignment
吴恩达深度学习 C1_W4_Assignment任务1:一步一步构建深层神经网络Part0:库的准备123456789101112131415import numpy as npimport h5pyimport matplotlib.pyplot as pltfrom testCases_v2 import *from dnn_utils_v2 import sigmoid, sigmoid_backward, relu, relu_backward%matplotlib inlineplt.rcParams['figure.figsize'] = (5.0, 4.0) # set d...
吴恩达深度学习 C1_W3_Assignment
吴恩达深度学习 C1_W3_Assignment任务:实现单隐藏二类分类神经网络Part0:库的准备123456789101112# Package importsimport numpy as npimport matplotlib.pyplot as pltfrom testCases import *import sklearnimport sklearn.datasetsimport sklearn.linear_modelfrom planar_utils import plot_decision_boundary, sigmoid, load_planar_dataset, ...
吴恩达深度学习 C1_W2_Assignment
吴恩达深度学习 C1_W2_Assignment任务:制作逻辑回归器来识别猫Part0:库的准备123456789import numpy as npimport matplotlib.pyplot as pltimport h5pyimport scipyfrom PIL import Imagefrom scipy import ndimagefrom lr_utils import load_dataset%matplotlib inline Part1:准备数据所给定的数据集包含被标定为猫或非猫的数据,每个图像的形状为(num_px, num_px, 3) ,其中3代表3个通道(...
吴恩达团队NLP C4_W2_Assignment
吴恩达团队NLP C4_W2_Assignment任务:从头实现TransformerPart1:数据准备1.1 库的准备1234567891011121314import sysimport osimport numpy as npimport textwrapwrapper = textwrap.TextWrapper(width=70)import traxfrom trax import layers as tlfrom trax.fastmath import numpy as jnp# to print the entire np arraynp.set_printoptio...
吴恩达团队NLP C4_W1_Assignment
吴恩达团队NLP C4_W1_Assignment任务:建立神经机器翻译模型(英语< — >德语)Part1:数据准备1.1 库的准备12345678from termcolor import coloredimport randomimport numpy as npimport traxfrom trax import layers as tlfrom trax.fastmath import numpy as fastnpfrom trax.supervised import training 1.2 导入数据123456789101112train_stream_fn...
吴恩达团队NLP C3_W4_Assignment
吴恩达团队NLP C3_W4_Assignment任务:判断两个问题是否重复Part1:数据生成器12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758def data_generator(Q1, Q2, batch_size, pad=1, shuffle=True): """Generator function that yields batches of data Args: Q1 (list): ...
吴恩达团队NLP C3_W3_Assignment
吴恩达团队NLP C3_W3_Assignment任务:命名实体识别(NER) French:地缘政治实体 Morocco:地理实体 Christmas:时间指标 其他不被视为命名实体 Part1:数据生成器 shuffle的好处:我们不使用索引直接访问句子列表的位置。相反,我们使用它从索引列表中选择一个索引。通过这种方式,我们可以改变遍历原始列表的顺序,保持原始列表不变。 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556de...
吴恩达团队NLP C3_W2_Assignment
吴恩达团队NLP C3_W2_Assignment任务:探索递归神经网络RNNPart1:将一行字符串中的字符都转化为unicode整数,将其称之为tensor(张量)12345678910111213141516171819def line_to_tensor(line, EOS_int=1): """Turns a line of text into a tensor Args: line (str): A single line of text. EOS_int (int, optional): End-of-sentence integer...
吴恩达团队NLP C3_W1_Assignment
吴恩达团队NLP C3_W1_Assignment任务:使用深度神经网络进行情感分析Part1:准备数据1.1 以8 : 2的比例准备训练集和验证集123456789101112131415161718192021222324import numpy as npall_positive_tweets, all_negative_tweets = load_tweets()print(f"The number of positive tweets: {len(all_positive_tweets)}")print(f"The number of negative tw...
avatar
鸣蜩十九
Always
友链
CSDN BiliBili