在查看新的CoreML API时,我看不到在生成.mlmodel并将其捆绑到您的应用程序后继续训练模型的任何方法.这让我觉得我无法对用户的内容或动作进行机器学习,因为模型必须事先经过完全训练.
发货后有没有办法将训练数据添加到我训练过的模型中?
编辑:我刚刚注意到你可以从URL初始化生成的模型类,所以也许我可以将新的训练数据发布到我的服务器,重新生成训练模型并将其下载到应用程序中?似乎它会起作用,但这完全打败了在没有用户数据离开设备的情况下能够使用ML的隐私方面.
有没有人知道iOS下使用OpenGL ES 2.0的线性代数库?
具体来说,我正在寻找一种方法,使用iOS设备上的GPU对任意大小的矩阵(例如,远大于4x4,更像是5,000 x 100,000)进行矩阵乘法.
我正在尝试更好地了解与Metal Performance Shaders
和一起使用时的同步要求MTLBlitCommandEncoder
。
我有一个MTLCommandBuffer
设置如下:
使用MTLBlitCommandEncoder
到纹理A的区域复制到纹理B. 纹理A比纹理B.大我提取纹理特征的一个“瓦”,并复制成质地B.
使用MPSImageBilinearScale
金属性能着色器,将纹理B作为源纹理,将第三纹理纹理C作为目标。此金属性能着色器将缩放并可能将纹理B的内容转换为纹理C。
在金属性能着色器开始尝试缩放纹理B之前,如何确保blit编码器完全完成了从纹理A到纹理B的数据复制?我什至不必担心这个问题,还是命令缓冲区的串行特性已经为我解决了这个问题?
Metal具有MTLFence
用于同步访问资源的围栅的概念,但是我仍然看不到要在围栅上等待Metal Performance Shader。(而waitForFence:
编码器上有。)
如果我不能使用篱笆并且需要同步,建议的做法是仅使blit编码器入队,然后waitUntilCompleted
在使着色器入队并再次调用之前调用命令缓冲区waitUntilCompleted
吗?例如:
id<MTLCommandBuffer> commandBuffer;
// Enqueue blit encoder to copy Texture A -> Texture B
id<MTLBlitCommandEncoder> blitEncoder = [commandBuffer blitCommandEncoder];
[blitEncoder copyFromTexture:...];
[blitEncoder endEncoding];
// Wait for blit encoder to complete.
[commandBuffer commit];
[commandBuffer waitUntilCompleted];
// Scale Texture B -> Texture C
MPSImageBilinearScale *imageScaleShader = [[MPSImageBilinearScale alloc] initWithDevice:...];
[imageScaleShader encodeToCommandBuffer:commandBuffer...];
// Wait …
Run Code Online (Sandbox Code Playgroud) 问:C ++中有什么编译时机制可用于自动验证模板类方法的集合是否从类专业化到专业化相匹配?
示例:让我们假设我想要一个类接口,该类接口的行为取决于模板值的特殊性:
// forward declaration of template class name
template <typename T, bool isZero> class MyClass;
// partial class specialization for isZero = false case
template <typename T> class MyClass <T, false>
{
T _val;
public:
MyClass(T value) { _val = value; }
T GetValue(void) const { return _val; }
};
// partial class specialization for isZero = true case
template <typename T> class MyClass <T, true>
{
public:
MyClass(T value) {}
T GetValue(void) const {return T(0);}
};
Run Code Online (Sandbox Code Playgroud)
这里的想法是,在星期二进行编译时,MyClass.GetValue()返回0,而在一周中的任何其他日子,我们都会得到期望值...或类似的东西。细节和动机并不重要。;-) …
原来没有这样的操作deconvolution
在MPS
.最接近的类比tensorflow
是conv2d_transpose
.
是否可以在MPS
默认操作之间进行插件自定义操作?