动手学深度学习 v2.0介绍。 lr = 0.03 num_epochs = 3 net = linreg loss = squared_loss for epoch in range(num_epochs): for X, y in data_iter(batch_size, features, labels): l = loss(net(X, w, b), y) # X和y的小批量损失 # 因为l形状是(batch_size sum().backward() sgd([w, b], lr, batch_size) # 使用参数的梯度更新参数 with torch.no_grad(): train_l = loss(net(features, w, b), labels) print(f'epoch {epoch + 1}, loss {float(train_l.mean()):f}') 3.2. 线性回归的从零开始实现 要工程师花一个月的时间重新开始编写网页,那并不高效。 对于标准深度学习模型,我们可以使用框架的预定义好的层。这使我们只需关注使用哪些层来构造模型,而 不必关注层的实现细节。我们首先定义一个模型变量net,它是一个Sequential类的实例。Sequential类将多 个层串联在一起。当给定输入数据时,Sequential实例将数据传入到第一层,然后将第一层的输出作为第二 层的输入,以此类推。0 码力 | 797 页 | 29.45 MB | 1 年前3
OpenShift Container Platform 4.13 网络name: sharded namespace: openshift-ingress-operator spec: domain:net> 1 nodePlacement: nodeSelector: matchLabels: node-role.kubernetes.io/worker: "" router-internal.yaml $ oc expose svc --hostname .apps- sharded.basedomain.example.net # cat router-internal.yaml apiVersion: operator.openshift.io/v1 kind: IngressController 第 第 8 章 name: sharded namespace: openshift-ingress-operator spec: domain: net> 1 nodePlacement: nodeSelector: matchLabels: node-role.kubernetes.io/worker: "" 0 码力 | 697 页 | 7.55 MB | 1 年前3
Docker 从入门到实践 0.4"{{ .State.Pid }}") 通过这个 PID,就可以连接到这个容器: $ nsenter --target $PID --mount --uts --ipc --net --pid 下面给出一个完整的例子。 $ sudo docker run -idt ubuntu 243c32535da7d142fb0e6df616a3c3ada0b8ab417937c853a9e1c251f499f550 nostalgic_hypatia $ PID=$(docker-pid 243c32535da7) 10981 $ sudo nsenter --target 10981 --mount --uts --ipc --net --pid root@243c32535da7:/# 更简单的,建议大家下载 .bashrc_docker,并将内容放到 .bashrc 中。 $ wget -P ~ https://github -h HOSTNAME or --hostname=HOSTNAME --配置容器主机名 --link=CONTAINER_NAME:ALIAS --添加到另一个容器的连接 --net=bridge|none|container:NAME_or_ID|host --配置容器的桥接模式 -p SPEC or --publish=SPEC --映射容器端口到宿主主机 -P 0 码力 | 179 页 | 2.27 MB | 1 年前3
pytorch 入门笔记-03- 神经网络import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self,): super(Net, self).__init__() # 输入图片通道数为 1,输出通道数为 6,卷积核大小为 (5, 5) self = 1 for s in size: num_features *= s return num_features net = Net() print(net) Net( (conv1): Conv2d(1, 6, kernel_size=(5, 5), stride=(1, 1)) (conv2): Conv2d(6, 16, kernel_size=(5 函数(用来计算梯度)会被 autograd 自动创建。 可以在 forward 函数中使用任何针对 Tensor 的操作。 net.parameters() 返回可被学习的参数(权重)列表和值 原文链接:pytorch 入门笔记 -03- 神经网络 params = list(net.parameters()) print(len(params)) print(params[0].size()) #0 码力 | 7 页 | 370.53 KB | 1 年前3
Docker 从入门到实践 0.9.0(2017-12-31)bridge-nf-call-ip6tables is disabled 请添加内核配置参数以启用这些功能。 $ sudo tee -a /etc/sysctl.conf <<-EOF net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF 然后重新加载 sysctl.conf 即可 $ sudo sysctl HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" docker run 就是运行容器的命令,具体格式我们会在 容器 一节进行详细讲解,我们这里简 要的说明一下上面用到的参数。 -it :这是两个参数,一个是 -i :交互式操作,一个是 bridge my-net -d 参数指定 Docker 网络类型,有 bridge overlay 。其中 overlay 网络类型用于 Swarm mode,在本小节中你可以忽略它。 连接容器 运行一个容器并连接到新建的 my-net 网络 $ docker run -it --rm --name busybox1 --network my-net busybox sh0 码力 | 370 页 | 6.73 MB | 1 年前3
Cloud Native Contrail Networking
Installation and Life Cycle ManagementGuide for Rancher RKE2
Juniper Networks, Inc. 1133 Innovation Way Sunnyvale, California 94089 USA 408-745-2000 www.juniper.net Juniper Networks, the Juniper Networks logo, Juniper, and Junos are registered trademarks of Juniper terms and conditions of the End User License Agreement ("EULA") posted at https://support.juniper.net/support/eula/. By downloading, installing or using such software, you agree to the terms and conditions Networks download site (https://support.juniper.net/support/downloads/?p=contrail-networking) and access the container repository at https://enterprise-hub.juniper.net. 2. Set up the fabric network and connect0 码力 | 72 页 | 1.01 MB | 1 年前3
OpenShift Container Platform 4.6 网络sharded namespace: openshift-ingress-operator spec: domain:net> nodePlacement: nodeSelector: matchLabels: 第 第 6 章 章 OPENSHIFT CONTAINER PLATFORM sharded namespace: openshift-ingress-operator spec: domain: net> nodePlacement: nodeSelector: OpenShift Container Platform 4.6 网 网络 络 42 2. 应用 Ingress 接口,附加到集群范围的 pod 网络。您可以使用 oc exec -it -- ip a 命令来查看 pod 的接 口。如果您添加使用 Multus CNI 的额外网络接口,则名称为 net1、net2、…、netN。 要将额外网络接口附加到 pod,您必须创建配置来定义接口的附加方式。您可以使用 NetworkAttachmentDefinition 自定义资源(CR)来指定各个接口。各个 0 码力 | 256 页 | 2.78 MB | 1 年前3
OpenShift Container Platform 4.9 网络sharded namespace: openshift-ingress-operator spec: domain:net> nodePlacement: nodeSelector: matchLabels: node-role.kubernetes.io/worker: sharded namespace: openshift-ingress-operator spec: domain: net> nodePlacement: nodeSelector: matchLabels: node-role.kubernetes.io/worker: follow_up_info 0 hybrid_e2e 0 inhibit_multicast_service 0 net_sync_monitor 0 tc_spanning_tree 0 tx_timestamp_timeout 10 0 码力 | 388 页 | 4.04 MB | 1 年前3
Oracle VM VirtualBox 7.0.0_BETA2 User Manualinstance will use the same network device names as the VM. 1. Change the GRUB kernel parameters. Add net.ifnames=0 and biosdevname=0 as kernel parameter values to the GRUB_CMDLINE_LINUX variable. 2. Update if an automated udev rule exists for net-persistence: # cd /etc/udev/rules.d # rm -f 70-persistent-net.rules # ln -s /dev/null /etc/udev/rules.d/70-persistent-net.rules • Enable the serial console. This letter to that shared folder. Alternatively, on the Windows command line, use the following command: net use x: \\vboxsvr\sharename While vboxsvr is a fixed name, note that vboxsrv would also work, replace0 码力 | 519 页 | 4.49 MB | 1 年前3
Oracle VM VirtualBox 7.0.8 User Manualinstance will use the same network device names as the VM. 1. Change the GRUB kernel parameters. Add net.ifnames=0 and biosdevname=0 as kernel parameter values to the GRUB_CMDLINE_LINUX variable. 2. Update if an automated udev rule exists for net-persistence: # cd /etc/udev/rules.d # rm -f 70-persistent-net.rules # ln -s /dev/null /etc/udev/rules.d/70-persistent-net.rules • Enable the serial console. This letter to that shared folder. Alternatively, on the Windows command line, use the following command: net use x: \\vboxsvr\sharename While vboxsvr is a fixed name, note that vboxsrv would also work, replace0 码力 | 546 页 | 4.37 MB | 1 年前3
共 292 条
- 1
- 2
- 3
- 4
- 5
- 6
- 30













