helm源码分析之create命令

Elasticsearch 报错 error At least one unigram is required but all tokens were ngrams 【代码】Elasticsearch 报错 error At least one unigram is required but all tokens were ngrams。 阅读详情

 欢迎关注我的公众号:

 目前刚开始写一个月,一共写了18篇原创文章,文章目录如下:

istio多集群探秘,部署了50次多集群后我得出的结论

istio多集群链路追踪,附实操视频

istio防故障利器,你知道几个,istio新手不要读,太难!

istio业务权限控制,原来可以这么玩

istio实现非侵入压缩,微服务之间如何实现压缩

不懂envoyfilter也敢说精通istio系列-http-rbac-不要只会用AuthorizationPolicy配置权限

不懂envoyfilter也敢说精通istio系列-02-http-corsFilter-不要只会vs

不懂envoyfilter也敢说精通istio系列-03-http-csrf filter-再也不用再代码里写csrf逻辑了

不懂envoyfilter也敢说精通istio系列http-jwt_authn-不要只会RequestAuthorization

不懂envoyfilter也敢说精通istio系列-05-fault-filter-故障注入不止是vs

不懂envoyfilter也敢说精通istio系列-06-http-match-配置路由不只是vs

不懂envoyfilter也敢说精通istio系列-07-负载均衡配置不止是dr

不懂envoyfilter也敢说精通istio系列-08-连接池和断路器

不懂envoyfilter也敢说精通istio系列-09-http-route filter

不懂envoyfilter也敢说精通istio系列-network filter-redis proxy

不懂envoyfilter也敢说精通istio系列-network filter-HttpConnectionManager

不懂envoyfilter也敢说精通istio系列-ratelimit-istio ratelimit完全手册

 

-------------------------------------------------------------------------------------------------------------

type createOptions struct {//create结构体
	starter    string // --starter
	name       string
	starterDir string
}
func newCreateCmd(out io.Writer) *cobra.Command {//创建create命令
	o := &createOptions{}//初始化结构体

	cmd := &cobra.Command{//创建cobra命令
		Use:   "create NAME",
		Short: "create a new chart with the given name",
		Long:  createDesc,
		Args:  require.ExactArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			o.name = args[0]//设置name
			o.starterDir = helmpath.DataPath("starters")//设置starter目录
			return o.run(out)//运行
		},
	}

	cmd.Flags().StringVarP(&o.starter, "starter", "p", "", "The name or absolute path to Helm starter scaffold")//starter选项
	return cmd
}
func (o *createOptions) run(out io.Writer) error {//运行
	fmt.Fprintf(out, "Creating %s\n", o.name)//打印

	chartname := filepath.Base(o.name)//获取chart名称
	cfile := &chart.Metadata{//构造chart元数据
		Name:        chartname,
		Description: "A Helm chart for Kubernetes",
		Type:        "application",
		Version:     "0.1.0",
		AppVersion:  "0.1.0",
		APIVersion:  chart.APIVersionV2,
	}

	if o.starter != "" {//如果starter不为空
		// Create from the starter
		lstarter := filepath.Join(o.starterDir, o.starter)//获取starter路径
		// If path is absolute, we don't want to prefix it with helm starters folder
		if filepath.IsAbs(o.starter) {//如果是绝对路径,设置lstarter
			lstarter = o.starter
		}
		return chartutil.CreateFrom(cfile, filepath.Dir(o.name), lstarter)//从starter创建chart
	}

	_, err := chartutil.Create(chartname, filepath.Dir(o.name))//创建chart
	return err
}
//从starter创建chart
func CreateFrom(chartfile *chart.Metadata, dest, src string) error {
	schart, err := loader.Load(src)//加载starter chart
	if err != nil {
		return errors.Wrapf(err, "could not load %s", src)
	}

	schart.Metadata = chartfile//设置chart元数据

	var updatedTemplates []*chart.File

	for _, template := range schart.Templates {//遍历templates
		newData := transform(string(template.Data), schart.Name())//转换template chart名称
		updatedTemplates = append(updatedTemplates, &chart.File{Name: template.Name, Data: newData})
	}

	schart.Templates = updatedTemplates//设置templates
	b, err := yaml.Marshal(schart.Values)//把values转换成yaml
	if err != nil {
		return errors.Wrap(err, "reading values file")
	}

	var m map[string]interface{}
	if err := yaml.Unmarshal(transform(string(b), schart.Name()), &m); err != nil {//转换values里的chart名称,然后转成map
		return errors.Wrap(err, "transforming values file")
	}
	schart.Values = m//设置values

	// SaveDir looks for the file values.yaml when saving rather than the values
	// key in order to preserve the comments in the YAML. The name placeholder
	// needs to be replaced on that file.
	for _, f := range schart.Raw {//遍历chart文件
		if f.Name == ValuesfileName {
			f.Data = transform(string(f.Data), schart.Name())//转换文件中chart的名称
		}
	}

	return SaveDir(schart, dest)//保存chart
}
func Create(name, dir string) (string, error) {//创建chart
	path, err := filepath.Abs(dir)//获取chart绝对路径
	if err != nil {
		return path, err
	}

	if fi, err := os.Stat(path); err != nil {//判断路径是否存在
		return path, err
	} else if !fi.IsDir() {//判断路径是否是目录
		return path, errors.Errorf("no such directory %s", path)
	}

	cdir := filepath.Join(path, name)//获取chart目录
	if fi, err := os.Stat(cdir); err == nil && !fi.IsDir() {//判断chart目录是否存在并且是目录
		return cdir, errors.Errorf("file %s already exists and is not a directory", cdir)
	}

	files := []struct {//设置要生成的chart文件
		path    string
		content []byte
	}{
		{
			// Chart.yaml
			path:    filepath.Join(cdir, ChartfileName),
			content: []byte(fmt.Sprintf(defaultChartfile, name)),
		},
		{
			// values.yaml
			path:    filepath.Join(cdir, ValuesfileName),
			content: []byte(fmt.Sprintf(defaultValues, name)),
		},
		{
			// .helmignore
			path:    filepath.Join(cdir, IgnorefileName),
			content: []byte(defaultIgnore),
		},
		{
			// ingress.yaml
			path:    filepath.Join(cdir, IngressFileName),
			content: transform(defaultIngress, name),
		},
		{
			// deployment.yaml
			path:    filepath.Join(cdir, DeploymentName),
			content: transform(defaultDeployment, name),
		},
		{
			// service.yaml
			path:    filepath.Join(cdir, ServiceName),
			content: transform(defaultService, name),
		},
		{
			// serviceaccount.yaml
			path:    filepath.Join(cdir, ServiceAccountName),
			content: transform(defaultServiceAccount, name),
		},
		{
			// NOTES.txt
			path:    filepath.Join(cdir, NotesName),
			content: transform(defaultNotes, name),
		},
		{
			// _helpers.tpl
			path:    filepath.Join(cdir, HelpersName),
			content: transform(defaultHelpers, name),
		},
		{
			// test-connection.yaml
			path:    filepath.Join(cdir, TestConnectionName),
			content: transform(defaultTestConnection, name),
		},
	}

	for _, file := range files {//遍历文件
		if _, err := os.Stat(file.path); err == nil {//如果文件存在则跳过
			// File exists and is okay. Skip it.
			continue
		}
		if err := writeFile(file.path, file.content); err != nil {//写入文件到磁盘
			return cdir, err
		}
	}
	// Need to add the ChartsDir explicitly as it does not contain any file OOTB
	if err := os.MkdirAll(filepath.Join(cdir, ChartsDir), 0755); err != nil {//添加charts目录
		return cdir, err
	}
	return cdir, nil
}

k8s use-context是什么 kubectl的命令用于在 Kubernetes 集群中切换上下文(context),从而方便地在多个集群或命名空间之间进行操作。一个上下文定义了kubectl使用的和的组合。 阅读详情

相关推荐

FreeCAD源码分析:Undo/Redo概述

Undo/Redo是CAx软件中常见的操作功能,其实现方法也相对比较成熟,本文对FreeCAD Transaction机制进行深入分析,一方面是为了深化对FreeCAD代码的理解,学习其设计思路,领略其设计模式的使用范式;另一方面则考虑到Undo/Redo功能的普遍性,旨在概述Undo/Redo的实现原理,希望对从事国产CAx软件开发的朋友有所帮助。

国产CAx(CAD/CAE/CAM)软件研发 4518

k8s实战之kubectl

本课程将详细介绍k8s所有命令,以及命令的go源码分析,学习知其然,知其所以然

Gemini 3.5 Flash长程Agentic能力深度实测与工程化落地指南

Agentic AI并非简单多步调用,而是指大模型在复杂任务中持续维护状态、自主规划工具链、闭环验证结果的系统性能力。其核心挑战在于上下文一致性、运行时语义理解及MCP等外部工具协同——这直接决定AI能否替代工程师完成端到端工程任务。当前主流模型如Gemini 3.5 Flash已在17步以上长程推理中展现稳定性,但仍在自我调试、符号与运行时语义对齐、跨协议状态感知等关键维度存在瓶颈。本文基于VS Code实战场景,解析Agentic工作流构建方法、GEMINI.md上下文建模技巧、MCP服务器选型策略及真

weixin_33725239的博客 410

helm源码分析之pull

发布一个k8s部署视频:https://edu.youkuaiyun.com/course/detail/26967 课程内容:各种k8s部署方式。包括minikube部署,kubeadm部署,kubeasz部署,rancher部署,k3s部署。包括开发测试环境部署k8s,和生产环境部署k8s。 腾讯课堂连接地址https://ke.qq.com/course/478827?taid=4373109931462251&tuin=ba64518 第二个视频发布https://edu.youkuaiyun.com/c..

mark's technic world 1370

千问3.6 Plus vs Gemma 4:国产AI编程模型实战对比

AI编程模型已超越通用语言理解,演进为面向工程实践的结构化代码生成系统。其核心在于将自然语言需求精准编译为符合框架规范、云厂商API和生产环境约束的可执行代码。关键技术价值体现在对中文技术生态(如TiDB、Seata、阿里云ROS)的深度适配能力,以及与IDE工具链的无缝集成水平。典型应用场景包括微服务并发修复、Airflow监控告警开发、Ant Design升级迁移等真实研发任务。千问3.6 Plus代表产线级工程闭环范式,Gemma 4体现开源研究型基座路径——二者差异本质是训练语料来源、工具链成熟度与

weixin_30596165的博客 414

Kubernetes Kubectl top 命令

kubectl top命令可显⽰节点和Pod对象的资源使⽤信息,它依赖于集群中的资源指标API来收集各项指标数据。它包含有node和pod两个⼦命令,可分别⽤于显⽰Node对象和Pod对象的相关资源占⽤率。,例如下⾯显⽰所有节点的资源占⽤状况的结果中显⽰了各节点累计CPU资源占⽤时长及百分⽐,以及内容空间占⽤量及占⽤⽐例。⽽名称空间级别的Pod对象资源占⽤率的使⽤⽅式会略有不同,使⽤时,⼀般应该限定名称空间及使⽤标签选择器过滤出⽬标Pod对象。列出Node资源占⽤率命令的语法格式为。

专注基础架构领域 2551

kubectl源码分析之create deployment

发布一个k8s部署视频:https://edu.youkuaiyun.com/course/detail/26967 课程内容:各种k8s部署方式。包括minikube部署,kubeadm部署,kubeasz部署,rancher部署,k3s部署。包括开发测试环境部署k8s,和生产环境部署k8s。 腾讯课堂连接地址https://ke.qq.com/course/478827?taid=4373109931462251&tuin=ba64518 第二个视频发布https://edu.youkuaiyun.com/c..

mark's technic world 747

哨兵一号burst数据的下载和处理

在Sentinel - 1数据处理领域,其基本流程起始于从(ASF)下载原始压缩文件。这些文件规模颇为可观,常规大小约4GB,而部分数据的原文件甚至已攀升至7GB,对存储空间提出了严苛要求。从影像构成来看,每景Sentinel - 1影像由三个干涉宽幅(IW)模式子带组成,每个IW一般包含9个脉冲串(burst)。然而,在实际研究中,我们所关注的研究区域往往仅占据其中寥寥几个burst。

kangkangluoluo的博客 1965

kubectl源码分析之create configmap

发布一个k8s部署视频:https://edu.youkuaiyun.com/course/detail/26967 课程内容:各种k8s部署方式。包括minikube部署,kubeadm部署,kubeasz部署,rancher部署,k3s部署。包括开发测试环境部署k8s,和生产环境部署k8s。 腾讯课堂连接地址https://ke.qq.com/course/478827?taid=4373109931462251&tuin=ba64518 第二个视频发布https://edu.youkuaiyun.com/c..

mark's technic world 460

STM32实战:ADXL345传感器驱动与数据采集全解析(IIC/SPI双模式适配)

本文详细解析了STM32驱动ADXL345传感器的全流程,包括IIC和SPI双模式适配、硬件连接、寄存器配置及数据采集处理。通过实战代码示例和常见问题排查指南,帮助开发者快速实现高精度加速度数据采集,适用于运动检测、姿态识别等多种嵌入式应用场景。

weixin_29171087的博客 314

vCenter Server出现no healthy upstream的解决方法

可以通过"VMware vCenter Server Management(服务)"来排查问题,在网页里面找到“服务”模块,会发现有很多服务没有启动起来,而且手动启动也无法启动。7.0 地址后,页面出现“no healthy upstream”,无法正常登录vCenter,重启后依旧如此,该故障的前提是没有对vCenter做过任何配置,如下图所示。于是用命令查询是否有证书过期,发现真有多个服务依赖的证书在当天早上过期。使用如下命令尝试打开服务发现不分服务可以打开,不分服务无法打开。

1万+

kubectl源码分析之create serviceaccount

发布一个k8s部署视频:https://edu.youkuaiyun.com/course/detail/26967 课程内容:各种k8s部署方式。包括minikube部署,kubeadm部署,kubeasz部署,rancher部署,k3s部署。包括开发测试环境部署k8s,和生产环境部署k8s。 腾讯课堂连接地址https://ke.qq.com/course/478827?taid=4373109931462251&tuin=ba64518 第二个视频发布https://edu.youkuaiyun.com/c..

mark's technic world 1135

AI大模型:(三)3.9 Deep Agents实现Agent

DeepAgents是基于LangChain的智能体框架,专为复杂长期任务设计。其通过分层架构解决传统局限,提供智能规划、虚拟文件系统、权限控制、任务委派、上下文管理、人机协同、模型适配及技能系统八大核心功能。相比基础LangChain,它内置状态持久化、流式处理和子智能体调度,显著提升可靠性与自主性。典型应用涵盖自动化编程、复杂业务流程编排及持续学习型研究助手。该框架支持多智能体协作,具备路由分发与动态技能加载能力,适用于需高自主性与安全控制的AI场景,有效实现从代码分析到人工审批的全流程自动化管理。

haylee的专栏 444

Infisical开源密钥管理平台:企业级机密数据保护架构剖析与实战指南

在现代分布式架构中,密钥管理已成为安全基础设施的核心组件。Infisical作为开源密钥管理平台,为团队提供了一套完整的机密数据保护解决方案。本文将从技术架构、部署策略、安全机制三个维度深入解析Infisical的设计理念与实施路径。 ## 技术架构解析:分层式密钥管理体系 Infisical采用模块化设计,将密钥管理、证书管理、特权访问管理三大核心功能解耦,形成清晰的系统边界。平台架构遵循"

gitblog_00010的博客 456

[xboard-real6410]39 real6410中的BL1和BL2实验及流程分析

文章目录uboot控制uboot 流程uboot加载kernel uboot控制 uboot 流程 uboot加载kernel

鹰之翔 298

【WRF运行报错】总结WRF运行时报错及解决方案(持续更新)

总结WRF运行时报错及解决方案(持续更新)

WW、forever的博客 1634

3.本地单机架构minikube

搭建minikube

weixin_47252600的博客 1148

图像修复的万能模型:用Instruct-IPT统一解决去雨、去雾、去模糊三大难题

从原理到实战,你已经掌握了Instruct-IPT的核心逻辑和使用方法。它不仅能一站式解决多种图像退化问题,还能通过文本指令灵活控制,是图像恢复领域的“多面手”。现在,不妨找几张有雨雪、雾霾、模糊问题的图像,用Instruct-IPT亲手试试效果。当你看到模糊的图像变得清晰,被雨雾遮挡的细节重新浮现时,你会真切感受到这项技术的魅力。后续还可以尝试调整文本指令的描述方式,看看模型的响应有什么变化——探索的过程,就是你技术进阶的最好见证。

m0_71589036的博客 227

通过 kubectl 查看 K8s 内节点、Pod 资源使用情况

kubectl describe node -n ${namespace} 例如:我要查看生产环境下所有节点的资源分配情况(生产环境的 namespace 为 product) kubectl describe node -n product

cab5的博客 8万+

Agentic AI为教育行业赋能,提示工程架构师解析应用潜力

然而,即便是最先进的 LLMs,在面对复杂、动态、需要持续规划和调整的教育场景时,也常常显得力不从心,它们更像是强大的“问答机器”,而非真正意义上的“学习伙伴”或“教学助手”。在教育场景中,传统的 AI 工具可能只能回答学生提出的特定问题,或者根据预设的规则推送一些学习材料。无论您是教育技术领域的开发者、产品经理,还是一线的教育工作者、教育管理者,抑或是对 AI 教育应用充满好奇的研究者,本文都将为您提供宝贵的 insights,助您把握 Agentic AI 时代教育创新的脉搏。

架构师的AI之路,分享AI应用开发架构的学习与实践。 467

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

【Kubernetes】kubectl top pod 异常?

kubectl top pod 异常?本文手把手解决,跟着小涛一块试试吧~

http://DBAtao.cn/ 1万+

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

centos 安装swoole问题

centos安装swoole

weixin_43946021的博客 722

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

分享kubectl的奇技淫巧

Kubectl 是 Kubernetes 最重要的命令行工具。在 Flant,我们会在 Wiki 和 Slack 上相互分享 Kubectl 的妙用(其实我们还有个搜索引擎,不过那就是另外一回事了)。多年以来,我们在 kubectl 方面积累了很多技巧,现在想要将其中的部分分享给社区。我相信很多读者对这些命令都非常熟悉;然而我还是希望读者能够从本文中有所获益,进而提高生产力。本文没什么结论,但是可以提供一个小列表,其中包含本文相关的有用链接。原文来自微信公众号《CNCF》

Vic的博客 1336

配置kubeconfig_kubectl use-context配置多集群访问

kubectl use-context配置多集群访问 今天在rancher平台上进行日常维护。在多个集群切换时,鼠标一顿点点点还是有点不够顺畅。于是在"瑞斯拜"的chrome里面找到了k8s有关多集群访问配置的桥段,下面根据实践过程做简单描述使用 kubeconfig 文件组织集群访问 通过 kubectl 连接k8s集群时,默认情况下,kubectl 会在 $HOME/.kube 目录下查找名为...

weixin_34883093的博客 3522

kubernetes对象

定义kubernetes对象 创建 Kubernetes 对象时,必须提供对象的规约,用来描述该对象的期望状态, 以及关于对象的一些基本信息(例如名称)。 当使用 Kubernetes API 创建对象时(或者直接创建,或者基于kubectl), API 请求必须在请求体中包含 JSON 格式的信息。 大多数情况下,需要在 .yaml 文件中为 kubectl 提供这些信息。 kubectl 在发起 API 请求时,将这些信息转换成 JSON 格式。 这里有一个 .yaml 示例文件,展...

whz-emm的博客 1182

k8s学习: kubeconfig文件详解

kubeconfig的一个示例如下:该示例为2个集群 apiVersion 和 kind 标识客户端解析器的版本和模式,不应手动编辑。preferences 指定当前可选(和当前未使用)的 kubectl 首选项cluster中包含k8s集群的端点数据,包括集群的证书颁发机构以及完整的URL。可以使用Kubectl config set-cluster添加或修改cluster条目。 可以使用 kubectl config set-cluster 添加或修改 cluster 条目,多个集群的话直接在后

Jerry00713的博客 1万+
上一篇: helm v3源码分析之总体
下一篇: helm源码分析之dependency list 命令
hxpjava1
博客等级 码龄19年 1365粉丝 511原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hxpjava1

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值