柯宥安

@AntonyKo

Joined on May 6, 2018

  • # detectron2:bug record ### image is bluish https://blog.csdn.net/u013608424/article/details/80117178 What image cv2 read is construct in BGR,while plt.imgshow() will read the image as RGB, so the picture will become bluish ### RuntimeError: cuda runtime error (710) : device-side assert triggered at /pytorch/aten/src/THC/generic/THCTensorMath.cu:196 https://discuss.pytorch.org/t/runtimeerror-cuda-runtime-error-59-device-side-assert-triggered-at-pytorch-aten-src-thc-generic-thctensormath-cu-24/
     Like 1 Bookmark
  • # Torchtext example ## Train with torchtext 這邊甚至沒學過pytorch的也可以看懂,雖然不是講pytorch但是卻也提到很多可以用的東西 https://github.com/bentrevett/pytorch-sentiment-analysis ## Dimensionality reduction and visualization https://www.deeplearn.me/2137.html https://www.kaggle.com/jeffd23/visualizing-word-vectors-with-t-sne ###### tags: `pytorch`
     Like  Bookmark
  • python 學習 === ==一個程式新手打的文章,希望大家多指教:smile:== # data type ## interger interger只會被記憶體的大小限制,只要你記憶體夠大裝的下的,他就可以顯示給你,不像C的int被限制在$2^{32}$裡 ## 虛數 ```python= >>> x=(3+2j) * (4+9j) >>> x (-6+35j) >>> x.real -6.0 >>> x.imag 35.0 ``` ## 運算符 /:除法 //: 取商數 Example: ```python= >>>9//3 3 >>> -5//3 -2 ``` **:指數 ## List ```python= >>> number=['one', 'two', 'three', 'four'] >>> number[0] one ``` 那如果是number[-1]會是甚麼? ```python= >>> number[-1] four ``` 也可以使用":"在list中 ```python= >>> number[:3] ['one', 'two', 'three']
     Like  Bookmark
  • # Note of: Applications of Blockchains in the Internet of Things: A Comprehensive Survey ### Architecture of the paper ![](https://i.imgur.com/jnhvSVV.jpg) other way is actually TDAG or DAG, blockchain's next development # Question after look through the paper ## This paper seem to emphasize the consesus algorithms. Why? Since consesus is an important trade off between performance and scalability for IoT applization. Sharding mechanisms in Ethereum and Tendermint can lead to leveraging th
     Like  Bookmark
  • # PPS case study PPS面對到一些問題: 1. 廣告商絕大多數不需要全國性的廣告,需要地區性的 2. 廣告商投入在線上的廣告費用約莫只有3% 3. 進攻國外市場困難,一是因為技術,二是因為版權 4. 國內用戶主要專注在16-25歲的用戶 用戶主要集中在16-25歲,所以我們這邊主要希望可以收到更多來自遊戲商的合作,比如看影片拿虛寶,這是雙向的互利,可以同時增加PPS的用戶跟遊戲的用戶,之後可以再填寫用戶個人資料時,詢問有游玩的遊戲,之後可以將這些會員的資料販售給遊戲商,以利於他去新增遊戲中的彩蛋劇情,或是,新增相關的遊戲道具。這部分能創造的收益不多,但是能加深用戶群,讓更多16-25歲的用戶加入PPS。 增加地區性直播,當年的中小型企業不需要全國性的廣告,可是網路卻會影響到全國的,反而沒有許多地區性的直播性質,所以增加地區性的直播,去直面廣告商的需求,吸收中小企業的廣告,同時分析會來看這項直播的人,誰屬於這個地區,以此加強地區的資訊。 下一步,分析過後,販售這些人的個人資料給不同的廠商,這符合他們對於地區性的要求,另外,在e-mail上加收費用,當年
     Like  Bookmark
  • --- disqus: hackmd --- # Note for A Survey of Blockchain Applied to Smart Cities ## Q : Why we apply blockchain on smart city? Challenge → Solution of blockchain 1. Number of data explode → decentralized system 2. Data may be modify → unauthorized modify in blockchain is not allow. 3. Sharing data to citizen → data in blockchain is transparent 4. Need incentive to encourage citizen participate → Blokchain has incentive mechanism The main point in smart citizen and smart healthcare is stora
     Like  Bookmark
  • numpy === ## 甚麼是numpy numpy是一個python中的模組 ## 為甚麼要用它 因為相比較於python中動態分配的list,用numpy這個底部用C和Fortran寫的,可以平行處理,效率較list高 ## 學習其他模組前的基石 此外 Python 其餘重量級的資料科學相關套件(例如:Pandas、SciPy、Scikit-learn 等)都幾乎是奠基在 Numpy 的基礎上,所以要學習其他模組之前先學習numpy奠定基礎會學得更快。 # numpy的重點在於陣列操作 Numpy 的重點在於陣列的操作,建立同質性且多維的陣列,ndarray ## 將list變為numpy.array 只要 ```python= >>> numpy.array(list) ``` 就可以換為numpy.array然後使用array的功能 ## 建立陣列 ```python= dim=(2,3) np1 = np.zeros([2, 3]) # array([[ 0., 0., 0.], [ 0., 0., 0.]]) np2 = np.ones([2, 3]) # a
     Like  Bookmark
  • HackerRank整理 === # Easy - [Dynamic Array](/9yKQM5ZVQu6LgsoH_FEd1g) - [Super Reduced String](/I2B7l8qeTjie_BU5MmsD_Q) - [Time Conversion](/DiKY8J_uQaeWi91TOIO4tw) - [Array Manipulation](/HZ52WzaITRaKvxSYPjQzSg) - [Validating phone numbers](/R4579-nkTLWxT998MJmzfA) - [sWAP cASE](/LthVFW5iSJaKQenrwom1oQ) - [Validating Roman Numerals](/Zi1wHj8UQmeMOtr9UrhfXw) - [Re.findall() & Re.finditer](/CQxxQ0aeSMq_lYRgtzAIGw) - [Re.start() & Re.end()](/Nqx6aI-5RQqNQgnTSFhkdw) - [Nested Lists](/nPOV_cmwQjeExdpgv
     Like  Bookmark
  • Leetcod寫過的整理 === 簡單的在這邊做個整理 - [3.Longest Substring Without Repeating Characters](/XKYJTpzcTkuxXLrP186CLQ) - [8. String to Integer (atoi)](/6xEUyFT8RtGcn9SxcTxIHA) - [11.Container With Most Water](/W_bERAU4S0Kj5JSB7ZI_jg) - [14.Longest Common Prefix](/vODZH5ptQ7WTO0SB5cbBeA) - [21.Merge Two Sorted Lists](/Ud_CkHt5RWSAEr4P57tcDg) - [29. Divide Two Integers](/96WGy2nZQ_WMzcbZLooULA) - [35. Search Insert Position](/cq930PX8RWavUgSu5GMmtg) - [38. Count and Say](/4CXSd7USQN2ehdzCF7jDjw) - [53. Maximum
     Like  Bookmark
  • # 5. Longest Palindromic Substring [題目](https://leetcode.com/problems/longest-palindromic-substring/) 在leetcode 用英文解釋過了,所以這邊有點懶得打,需要中文解釋在留言跟我說 I have seen a [easy-understanding video](https://www.youtube.com/watch?v=nbTSfrEfo6M),so I can make it. Manacher's algorithm has an important point to break a hurting point. The hurting point is we have to expand every center what make our time complexity O(N^2) How can we break the point? We use the palindromic we count before. s=abababa P=1357??? In the
     Like  Bookmark
  • Dynamic Array === [題目](https://www.hackerrank.com/challenges/dynamic-array/problem) 這題是自己打的,題目還算是有點挑戰性,不過閱讀上出現些問題,因為東西有點多 ```python= #!/bin/python3 import math import os import random import re import sys # # Complete the 'dynamicArray' function below. # # The function is expected to return an INTEGER_ARRAY. # The function accepts following parameters: # 1. INTEGER n # 2. 2D_INTEGER_ARRAY queries # def dynamicArray(n, queries): # Write your code here lastanswer=0 s=[] for _
     Like  Bookmark
  • 3.Longest Substring Without Repeating Characters === [題目](https://leetcode.com/problems/longest-substring-without-repeating-characters/) 這是抄的,這題有點難,這個解法不是甚麼演算法,不過卻也蠻漂亮的,我暫時找不到反例,先去研究另一個演算法 ```python= class Solution: def lengthOfLongestSubstring(self, s: str) -> int: d='' f='' for i in range(len(s)): if s[i] not in f: f+=s[i] else: #不像下面的要去判斷在不在字串中,因為他用了in if len(d)<len(f): d=f
     Like  Bookmark