Skip to content

Instantly share code, notes, and snippets.

View jnordberg's full-sized avatar
💾
Floppy

Johan Nordberg jnordberg

💾
Floppy
View GitHub Profile
diff --git a/mylib/mrf.lua b/mylib/mrf.lua
index ef65bd4..0b86b91 100755
--- a/mylib/mrf.lua
+++ b/mylib/mrf.lua
@@ -149,7 +149,21 @@ function MRFMM:updateGradInput(input, gradOutput)
self.nOutputPlane = i_end - i_start + 1
-- local timer_CONV = torch.Timer()
- local temp = input.nn.SpatialConvolutionMM_updateOutput(self, input)
+ -- local temp = input.nn.SpatialConvolutionMM_updateOutput(self, input)
@jnordberg
jnordberg / _.md
Last active February 13, 2017 00:27
neural video memory usage

Keybase proof

I hereby claim:

  • I am jnordberg on github.
  • I am jnordberg (https://keybase.io/jnordberg) on keybase.
  • I have a public key whose fingerprint is F878 7D7B 280C 6571 59D0 AD4F E935 1214 2687 D6F1

To claim this, I am signing this object:

import Combine
final class ObservableOptional<Wrapped: ObservableObject>: ObservableObject {
let objectWillChange = ObservableObjectPublisher()
var value: Wrapped? {
willSet {
objectWillChange.send()
updateSubscription(newValue)
}
}
@jnordberg
jnordberg / finishable.swift
Last active January 26, 2021 22:38
Swift Combine framework publisher that allows you to finish/cancel/close the stream based on its contents.
public struct FinishablePublisher<Upstream>: Publisher where Upstream: Publisher {
public typealias Output = Upstream.Output
public typealias Failure = Upstream.Failure
private let upstream: Upstream
private let inspector: (Output) -> Bool
init(upstream: Upstream, shouldFinish inspector: @escaping (Output) -> Bool) {
self.upstream = upstream
self.inspector = inspector
^__^
I <3 (oo)\_______
Open (__)\ )\/\
Source ||----w |
|| ||
Grapefruits are funny
What is code? Please don't hurt me
Asynchronous mode