type: PIN
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
type: PIN
Consumer key: IQKbtAYlXLripLGPWd0HUA
| import boto3 | |
| from boto3.s3.transfer import S3Transfer | |
| from flask import Flask, Response | |
| app = Flask(__name__) | |
| class S3Storage: | |
| def __init__(self, bucket_name, pictures_path="", video_path=""): |
| sample = np.random.choice(processed_data.index, size=int(len(processed_data)*0.9), replace=False) | |
| train_data, test_data = processed_data.iloc[sample], processed_data.drop(sample) |
| cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
| -D CMAKE_INSTALL_PREFIX=/usr/local \ | |
| -D INSTALL_PYTHON_EXAMPLES=ON \ | |
| -D INSTALL_C_EXAMPLES=OFF \ | |
| -D OPENCV_ENABLE_NONFREE=ON \ | |
| -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ | |
| -D PYTHON_EXECUTABLE=~/.local/share/virtualenvs/kaggle-3VckuriQ/bin/python \ | |
| -D PYTHON_NUMPY_INCLUDE_DIR=~/.local/share/virtualenvs/kaggle-3VckuriQ/lib/python3.6/site-packages/numpy/core/include/ \ | |
| -D BUILD_opencv_python3=yes -D PYTHON_LIBRARY=/home/niyas/anaconda3/lib/libpython3.6m.so -D BUILD_EXAMPLES=ON .. |
| # https://github.com/mstamy2/PyPDF2/issues/53 | |
| import os, shutil, tempfile | |
| from pathlib import Path | |
| # Things from the subprocess module don't rely on the shell unless you | |
| # explicitly ask for it and can accept a pre-split list of arguments, | |
| # making calling subprocesses much safer. | |
| # (If you really do need to split quoted stuff, use shlex.split() instead) | |
| from subprocess import check_call | |
| # [...] |
nn.CrossEntropyLoss() would automatically apply a softmax over the last layer.
Especially in Jupyter Lab.
This is particularly weird because it won't raise any errors and your loss will appear to be stable and the model will not learn anything
| from abc import ABC | |
| from enum import Enum | |
| class BankAccount: | |
| OVERDRAFT_LIMIT = -500 | |
| def __init__(self, balance=0): | |
| self.balance = balance |
| # References: | |
| # https://github.com/PrettyPrinted/youtube_video_code/blob/master/2020/12/31/How%20to%20Speed%20Up%20API%20Requests%20With%20Async%20Python/apiasync/script.py | |
| # https://stackoverflow.com/questions/47934212/how-to-use-python-aiohttp-library-to-download-multiple-webpages | |
| # https://pawelmhm.github.io/asyncio/python/aiohttp/2016/04/22/asyncio-aiohttp.html | |
| import aiohttp | |
| import aiofiles | |
| import asyncio | |
| URLS = [] # populate this |
| ffresize(){ | |
| for f in *.mp4 ; do ffmpeg -i "$f" -vf scale=854:480 "$f-480p.mp4" ; done | |
| } |