如何在gpflow中修复内核长度尺度的某些尺寸?

问题描述

我有一个2d内核,

    colorPixelFormat = .rgba16Float
    if let caml = layer as? CAMetalLayer {
        caml.wantsExtendedDynamicRangeContent = true
        let name = CGColorSpace.extendedLinearITUR_2020
        caml.colorspace = CGColorSpace(name: name)

        let edrMetadata = CAEDRMetadata.hdr10(minLuminance: 0.5,maxLuminance: 1000,opticalOutputScale: 100)
        caml.edrMetadata = edrMetadata
     }

我想将长度比例尺固定在第二维,然后优化另一个。

我可以使用禁用所有长度比例优化,

       let pipelineDescriptor = MTLRenderPipelineDescriptor()
        pipelineDescriptor.sampleCount = 1
        if(bIs10Bit == false){
            pipelineDescriptor.colorAttachments[0].pixelFormat = .bgra8Unorm
        }
        else{
            pipelineDescriptor.colorAttachments[0].pixelFormat = .rgba16Float
        }
        
        pipelineDescriptor.depthAttachmentPixelFormat = .invalid
        
        pipelineDescriptor.vertexFunction = library.makeFunction(name: vertexName)
        pipelineDescriptor.fragmentFunction = library.makeFunction(name: fragmentName)


        guard let state = try? device.makeRenderPipelineState(descriptor: pipelineDescriptor) else {
            print("create render pipeline state failed")
            return nil
        }

但是我不能仅将一个维度传递给该方法。

在GPy中,我们会调用k = gpflow.kernels.RBF(lengthscales=[24*5,1e-5]) m = gpflow.models.GPR(data=(X,Y),kernel=k,mean_function=None) 之类的东西。

也许我可以使用一个转换来大致实现这一目标(例如here),但这很复杂。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)