当前位置: 首页 > news >正文

LODGE 学习笔记

目录

高斯喷洒预测:

pytorch_lightning版本问题

训练笔记

损失函数;

训练加载数据

SMPLX_Skeleton

motion处理


高斯喷洒预测:

noise为空,输入只有cond,6*256*35

    def render_sample(self, shape, cond, normalizer, epoch, render_out, fk_out=None, name=None, sound=True, mode="normal", noise=None, constraint=None, sound_folder="ood_sliced", start_point=None, render=True, genre=None, # do_normalize=False,):if isinstance(shape, tuple):if mode == "inpaint":func_class = self.inpaint_loopelif mode == "inpaint_soft":func_class = self.inpaint_soft_loopelif mode == "inpaint_soft_ddim":func_class = self.inpaint_soft_ddimelif mode == "normal":func_class = self.ddim_sampleelif mode == "long":func_class = self.long_ddim_sampleelse:assert False, "Unrecognized inference mode"samples = (func_class(shape, cond, genre, noise=noise, constraint=constraint, start_point=start_point, ).detach().cpu())

每隔20次预测1次,扩散50次,x是随机数输入,迭代后更新x值,网络输出就是x。

  for time, time_next, weight in tqdm(time_pairs, desc='sampling loop time step'):time_cond = torch.full((batch,), time, device=device, dtype=torch.long)pred_noise, x_start, *_ = self.model_predictions(x, cond, genre, time_cond, weight=weight, clip_x_start=self.clip_denoised)

pytorch_lightning版本问题

安装最新的版本2.0.0以上,会有不兼容的问题

安装1.9.3和以下,也会报参数错误。

测试ok

pip install pytorch-lightning==1.9.4

optimizer_idx

训练笔记

参数文件:

configs/lodge/finedance_fea139_finetune_v2.yaml

损失函数;

    def loss(self, x, cond, genre_id, t_override=None, isgen=False):batch_size = len(x)if t_override is None:t = torch.randint(0, self.n_timestep, (batch_size,), device=x.device).long()else:t = torch.full((batch_size,), t_override, device=x.device).long()return self.p_losses(x, cond, genre_id, t, isgen)def forward(self, x, cond, genre_id=None, t_override=None, isgen=False):return self.loss(x, cond, genre_id, t_override, isgen)

训练加载数据

    def __getitem__(self, index):motion_index = self.motion_index[index]music_index = self.music_index[index]motion = self.motion[motion_index:motion_index+self.seq_len]music = self.music[music_index:music_index+self.seq_len]genre = self.genre_list[index]return motion, music, genre

SMPLX_Skeleton

        self.smplx_fk = SMPLX_Skeleton(Jpath='/data2/lrh/project/dance/Lodge/lodge_pub/data/smplx_neu_J_1.npy', device=cfg.DEVICE)  # debug 这里的DEVICE?if features.shape[2] == 315:trans, rot6d = torch.split(features, (3, features.shape[2] - 3), dim=2)  # 前4维是foot contactb, s, c = rot6d.shapelocal_q_156 = ax_from_6v(rot6d.reshape(b, s, -1, 6))joints = self.smplx_fk.forward(local_q_156, trans)joints = joints.view(b, s, 55, 3)return joints

motion处理

       for name in tqdm(self.datalist):name = name + ".npy"if name[:-4] in ignor_list:continuemotion = np.load(os.path.join(self.motion_dir, name))if dataname == "AISTPP":motion = motion[::2]music = np.load(os.path.join(self.music_dir, name))min_all_len = min(motion.shape[0], music.shape[0])motion = motion[:min_all_len]if motion.shape[-1] == 319 and args.FINEDANCE.nfeats ==139:motion = motion[:,:139]elif motion.shape[-1] == 139:passelse:print("motion.shape", motion.shape)

相关文章:

  • volatile,synchronized,reentranlock,CAS详解
  • go env 命令详解
  • TouchGFX之Button
  • JavaEE企业级分布式高级架构师课程
  • python知识点总结(十)
  • Chrome 插件 storage API 解析
  • 类的定义与实例化
  • AI大模型学习:AI大模型在特定领域的应用
  • 华为OD七日集训第5期 - 按算法分类,由易到难,循序渐进,玩转OD
  • 工业无线网关在汽车制造企业的应用效果和价值-天拓四方
  • C# 多态 派生类 abstract virtual new
  • JSP基础
  • 登录拦截器
  • unity无法使用道路生成插件Road Architect(ctrl和shift无法标点)
  • SAP_MMQM模块-采购收货质量控制
  • [rust! #004] [译] Rust 的内置 Traits, 使用场景, 方式, 和原因
  • docker-consul
  • ES6核心特性
  • Gradle 5.0 正式版发布
  • Leetcode 27 Remove Element
  • MySQL主从复制读写分离及奇怪的问题
  • Nacos系列:Nacos的Java SDK使用
  • TypeScript实现数据结构(一)栈,队列,链表
  • 构建二叉树进行数值数组的去重及优化
  • 今年的LC3大会没了?
  • 开放才能进步!Angular和Wijmo一起走过的日子
  • 区块链将重新定义世界
  • 首页查询功能的一次实现过程
  • 微信小程序:实现悬浮返回和分享按钮
  • 延迟脚本的方式
  • 译米田引理
  • UI设计初学者应该如何入门?
  • 东超科技获得千万级Pre-A轮融资,投资方为中科创星 ...
  • 说说我为什么看好Spring Cloud Alibaba
  • (04)odoo视图操作
  • (4)logging(日志模块)
  • (C语言)深入理解指针2之野指针与传值与传址与assert断言
  • (delphi11最新学习资料) Object Pascal 学习笔记---第7章第3节(封装和窗体)
  • (done) 两个矩阵 “相似” 是什么意思?
  • (pojstep1.3.1)1017(构造法模拟)
  • (附源码)ssm基于web技术的医务志愿者管理系统 毕业设计 100910
  • (三)Pytorch快速搭建卷积神经网络模型实现手写数字识别(代码+详细注解)
  • (一)ClickHouse 中的 `MaterializedMySQL` 数据库引擎的使用方法、设置、特性和限制。
  • (一)搭建springboot+vue前后端分离项目--前端vue搭建
  • .NET CLR基本术语
  • .net core webapi Startup 注入ConfigurePrimaryHttpMessageHandler
  • .NET Core 中插件式开发实现
  • .Net Core 中间件验签
  • .NET Core中的去虚
  • .net oracle 连接超时_Mysql连接数据库异常汇总【必收藏】
  • .Net 路由处理厉害了
  • .Net(C#)常用转换byte转uint32、byte转float等
  • .NET/C# 中设置当发生某个特定异常时进入断点(不借助 Visual Studio 的纯代码实现)
  • .netcore 如何获取系统中所有session_ASP.NET Core如何解决分布式Session一致性问题
  • .net反混淆脱壳工具de4dot的使用