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

泉州哪里做网站班级优化大师的优点

泉州哪里做网站,班级优化大师的优点,b2c模式的优势和劣势,华宇万户网络Rotation 类(rigid_utils 模块)是 AlphaFold3 中用于 3D旋转 的核心组件,支持两种旋转表示: 1️⃣ 旋转矩阵 (3x3) 2️⃣ 四元数 (quaternion, 4元向量) 👉 设计目标: 允许灵活选择 旋转矩阵 或 四元数 封装了常用的 旋转操作(组合、逆旋转、应用到点上等) 像 torch.…

Rotation 类(rigid_utils 模块)是 AlphaFold3 中用于 3D旋转 的核心组件,支持两种旋转表示: 1️⃣ 旋转矩阵 (3x3)
2️⃣ 四元数 (quaternion, 4元向量)

👉 设计目标

  • 允许灵活选择 旋转矩阵 或 四元数

  • 封装了常用的 旋转操作(组合、逆旋转、应用到点上等)

  • 像 torch.Tensor 一样,支持索引、拼接、广播等操作

源代码:

class Rotation:"""A 3D rotation. Depending on how the object is initialized, therotation is represented by either a rotation matrix or aquaternion, though both formats are made available by helper functions.To simplify gradient computation, the underlying format of therotation cannot be changed in-place. Like Rigid, the class is designedto mimic the behavior of a torch Tensor, almost as if each Rotationobject were a tensor of rotations, in one format or another."""def __init__(self,rot_mats: Optional[torch.Tensor] = None,quats: Optional[torch.Tensor] = None,normalize_quats: bool = True,):"""Args:rot_mats:A [*, 3, 3] rotation matrix tensor. Mutually exclusive withquatsquats:A [*, 4] quaternion. Mutually exclusive with rot_mats. Ifnormalize_quats is not True, must be a unit quaternionnormalize_quats:If quats is specified, whether to normalize quats"""if((rot_mats is None and quats is None) or (rot_mats is not None and quats is not None)):raise ValueError("Exactly one input argument must be specified")if((rot_mats is not None and rot_mats.shape[-2:] != (3, 3)) or (quats is not None and quats.shape[-1] != 4)):raise ValueError("Incorrectly shaped rotation matrix or quaternion")# Force full-precisionif(quats is not None):quats = quats.to(dtype=torch.float32)if(rot_mats is not None):rot_mats = rot_mats.to(dtype=torch.float32)if(quats is not None and normalize_quats):quats = quats / torch.linalg.norm(quats, dim=-1, keepdim=True)self._rot_mats = rot_matsself._quats = quats@staticmethoddef identity(shape,dtype: Optional[torch.dtype] = None,device: Optional[torch.device] = None,requires_grad: bool = True,fmt: str = "quat",) -> Rotation:"""Returns an identity Rotation.Args:shape:The "shape" of the resulting Rotation object. See documentationfor the shape propertydtype:The torch dtype for the rotationdevice:The torch device for the new rotationrequires_grad:Whether the underlying tensors in the new rotation objectshould require gradient computationfmt:One of "quat" or "rot_mat". Determines the underlying formatof the new object's rotation Returns:A new identity rotation"""if(fmt == "rot_mat"):rot_mats = identity_rot_mats(shape, dtype, device, requires_grad,)return Rotation(rot_mats=rot_mats, quats=None)elif(fmt == "quat"):quats = identity_quats(shape, dtype, device, requires_grad)return Rotation(rot_mats=None, quats=quats, normalize_quats=False)else:raise ValueError(f"Invalid format: f{fmt}")# Magic methodsdef __getitem__(self, index: Any) -> Rotation:"""Allows torch-style indexing over the virtual shape of the rotationobject. See documentation for the shape property.Args:index:A torch index. E.g. (1, 3, 2), or (slice(None,))Returns:The indexed rotation"""if type(index) != tuple:index = (index,)if(self._rot_mats is not None):rot_mats = self._rot_mats[index + (slice(None), slice(None))]return Rotation(rot_mats=rot_mats)elif(self._quats is not None):quats = self._quats[index + (slice(None),)]return Rotation(quats=quats, normalize_quats=False)else:raise ValueError("Both rotations are None")def __mul__(self,right: torch.Tensor,) -> Rotation:"""Pointwise left multiplication of the rotation with a tensor. Can beused to e.g. mask the Ro
http://www.dtcms.com/wzjs/257929.html

相关文章:

  • 做论坛网站用什么系统香港服务器
  • 杭州网页设计工作室桂林网站优化
  • 网站域名解析时间百度seo排名优化软件分类
  • 计算机软件开发培训班宝鸡百度seo
  • 摄影网站有哪些功能软文推广去哪个平台好
  • 西安网站制作开发公司哪家好推广普通话手抄报内容怎么写
  • 网站的请求服务做优先级济南网站建设制作
  • 做智能家居网站深圳网站优化推广方案
  • wordpress 主题css路径网站优化外包
  • 桂林北站改造最新方案免费搭建自己的网站
  • 江门制作网站公司域名服务器地址查询
  • 专业的集团网站制作企业持啊传媒企业推广
  • 网站建设 客户同程国内新闻最新消息今天简短
  • 网页美工设计photoshop 规划教材长沙做优化的公司
  • 网站建设 有聊天工具的吗网站维护的内容有哪些
  • 网站建设 无锡网络软文写作
  • 南阳做网站哪家好酒店如何进行网络营销
  • 淘宝移动网站建设网络营销的主要手段
  • 聊城做网站推广费用推广竞价的公司有哪些
  • 做兽药网站用什么图片好搜索关键词推荐
  • 宝安网站制作公司怎么在百度上做广告推广
  • 河南省建设厅官方网站郭风春厦门网络推广
  • 合网站 - 百度一个新产品怎么推广
  • 宣传推广计划谷歌seo
  • WordPress上展示PDF武汉seo培训
  • 哪些网站做外贸效果好深圳英文网站推广
  • 做网站怎么写工作日志2021年网络热点舆论
  • 天津低价做网站最全的百度网盘搜索引擎
  • 信阳建设企业网站公司什么是信息流广告
  • 东莞的网站建设宁波正规seo推广公司