- The paper demonstrates how simple CNNs, built on top of word embeddings, can be used for sentence classification tasks.
- Link to the paper
- Implementation
This file contains 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
#!/bin/bash | |
# Download GitKraken | |
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz | |
# copy the downloaded file into /opt directory | |
cp gitkraken-amd64.tar.gz /opt/gitkraken | |
cd /opt |
This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 desktop.
I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti.
Both of them can be shown via lspci | grep VGA
.
00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# Written by Luis Mesas | |
import threading | |
import time | |
import cv2 | |
# Define video capture class | |
class VideoCaptureAsync: | |
def __init__(self, src=0, width=640, height=480, driver=None): | |
self.src = src | |
if driver is None: |
This file contains 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 cv2 | |
# Import the video capturing function | |
from video_capture import VideoCaptureAsync | |
import time | |
#Specify width and height of video to be recorded | |
vid_w = 1280 | |
vid_h = 720 | |
#Intiate Video Capture object | |
capture = VideoCaptureAsync(src=0, width=vid_w, height=vid_h) |
This file contains 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 the recording process | |
from camera_record import record_video | |
# set recording duration | |
record_time = 20 | |
# To run this as part of a bigger program, use mutltiprocessing to create a seperate process | |
# for video recording using the following lines. | |
from multiprocessing import Process | |
# The line above can go to the top of your file and the following lines should be placed | |
# where ever you need to record a video | |
# Create the process thread object |
This file contains 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
from numpy import linalg as la | |
def nearestPD(A): | |
"""Find the nearest positive-definite matrix to input | |
A Python/Numpy port of John D'Errico's `nearestSPD` MATLAB code [1], which | |
credits [2]. | |
[1] https://www.mathworks.com/matlabcentral/fileexchange/42885-nearestspd |
This file contains 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
class AE(nn.Module): | |
def __init__(self, **kwargs): | |
super().__init__() | |
self.encoder_hidden_layer = nn.Linear( | |
in_features=kwargs["input_shape"], out_features=128 | |
) | |
self.encoder_output_layer = nn.Linear( | |
in_features=128, out_features=128 | |
) | |
self.decoder_hidden_layer = nn.Linear( |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer