This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.kotlinnlp.simplednn.simplemath.ndarray.dense.DenseNDArray | |
fun List<DenseNDArray>.sumWithPrevAndNext(): List<DenseNDArray> = this.indices.map { i -> | |
val cur = this[i].copy() | |
if (i > 0) cur.assignSum(this[i - 1]) | |
if (i < this.lastIndex) cur.assignSum(this[i + 1]) | |
cur | |
} | |
fun List<DenseNDArray>.addBackwardOfSumWithPrevAndNext(gradients: List<DenseNDArray>) = this.indices.map { i -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func reverse(lst []string) chan string { | |
ret := make(chan string) | |
go func() { | |
for i, _ := range lst { | |
ret <- lst[len(lst)-1-i] | |
} | |
close(ret) | |
}() | |
return ret | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see http://www.netlib.org/clapack/cblas/dgemv.c | |
package main | |
/* | |
#cgo LDFLAGS: -L/usr/lib/libblas -lblas | |
#include <stdlib.h> | |
extern void dgemv_(char* trans, int *m, int *n, double *alpha, | |
double *A, int *lda, double *x, int *incx, double *beta, double *y, | |
int *incy); | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get po --all-namespaces --field-selector 'status.phase==Failed' -o json | kubectl delete -f - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------ | |
-- -- | |
-- Copyright (C) 2011-2017 Matteo Grella <[email protected]> -- | |
-- -- | |
-- This work is licensed under a Creative Commons -- | |
-- Attribution-ShareAlike 4.0 International License. -- | |
-- -- | |
-- This file contains a subset of the Italian Grammar expressed as a set -- | |
-- of constraints, in line with WCDG formalism. The 243 constraints below -- | |
-- are used in my most recent dependency parsing experiments which combine -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mypool | |
// MyPool is a naive implementation of a pool, based on broadcast channel. | |
// You can use this pool in the same way you use sync.Pool. | |
type MyPool struct { | |
pool chan interface{} | |
// New optionally specifies a function to generate | |
// a value when Get would otherwise return nil. | |
New func() interface{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"reflect" | |
"github.com/nlpodyssey/spago/ag" | |
"github.com/nlpodyssey/spago/gd" | |
"github.com/nlpodyssey/spago/gd/sgd" |
OlderNewer