日時: | 2022-03-28 |
---|---|
作: | voluntas |
バージョン: | 2022.5 |
URL: | https://voluntas.github.io/ |
日時: | 2019-03-13 |
---|---|
作: | @voluntas |
バージョン: | 19.03.0 |
url: | https://voluntas.github.io/ |
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
*.img | |
*.raw |
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 https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [{ | |
"taskName": "Run Python", | |
"group": { | |
"kind": "build", | |
"isDefault": true | |
}, |
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
Debian installer on a USB key with a writable file system. | |
I couldn't find a concise article about creating a Debian installer USB | |
key with a writable file system, so here is my take. This assumes you | |
have an available Linux system. Note that some old BIOSes might not | |
happily boot USB drives created in this way. | |
* Install the packages syslinux dosfstools mbr | |
* Insert the thumb drive and find the device using dmesg | |
* Install a Master Boot Record to the drive (install-mbr /dev/sdX) |
Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav
Hello, brethren :-)
As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".
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
__author__ = 'breddels' | |
""" | |
Demonstrates combining Qt and tornado, both which want to have their own event loop. | |
The solution is to run tornado in a thread, the issue is that callbacks will then also be executed in this thread, and Qt doesn't like that. | |
To fix this, I show how to use execute the callback in the main thread, using a Qt signal/event in combination with Promises. | |
The output of the program is: | |
fetch page, we are in thread <_MainThread(MainThread, started 47200787479520)> | |
response is 191548 bytes, we are in thread <Thread(Thread-1, started daemon 47201018689280)> | |
the other thread should fulfil the result to this promise, we are in thread <Thread(Thread-1, started daemon 47201018689280)> |
更新: | 2024-05-20 |
---|---|
作者: | @voluntas |
バージョン: | 2024.1 |
URL: | https://voluntas.github.io/ |
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
require 'nn' | |
input = torch.DoubleTensor{4} --input word index | |
target = torch.DoubleTensor{6,5,4,2} --target word indices. So we have 1 true context ("6") and 3 negative contexts ("5,4,2") | |
label = torch.DoubleTensor({1,0,0,0}) --the first label is true sample, rest are neg samples | |
model1 = nn.Sequential() | |
model1:add(nn.LookupTable(1000,4)) -- word embedding layer, vocab size is 1000 and each word is 50 dimensional | |
model2 = nn.Sequential() | |
model2:add(nn.LookupTable(1000,4)) -- context embedding layer, this will be dot producted with an element of the word embedding layer |
NewerOlder