]]>colabhttp://www.shnenglu.com/guijie/archive/2018/12/21/216130.html杰哥杰哥Fri, 21 Dec 2018 01:07:00 GMThttp://www.shnenglu.com/guijie/archive/2018/12/21/216130.htmlhttp://www.shnenglu.com/guijie/comments/216130.htmlhttp://www.shnenglu.com/guijie/archive/2018/12/21/216130.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/216130.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/216130.html
How to create a folder in colab? h搜烦(ch): colab new folder扑ֈq个链接: https://medium.com/lean-in-women-in-tech-india/google-colab-the-beginners-guide-5ad3b417dfa
Create a Colab Notebook
Open Google Colab.
Click on ‘New Notebook’ and select Python 2 notebook or Python 3 notebook.
OR
Open Google Drive.
Create a new folder for the project.
Click on ‘New’ > ‘More’ > ‘Colaboratory’.
Google Drive -> 我的云端盘 -> 新徏文g? Click on ‘New’ > ‘More’ > ‘Colaboratory’,q个怎么操作? 例如选中"02_backprop.ipynb", 打开方式, 兌更多应用, 选择colab. q样在google drive里就可以选中"02_backprop.ipynb", 打开方式, ‘Colaboratory’卛_.但直接打开Colab, Google drive里面是没?02_backprop.ipynb", Recent有。暂不折腾这个问? Zhengxia说colab应该?x)?否则大家都把它当|盘使用
02_backprop.ipynb, 最开始Forward propagation上面, device改ؓ(f)GPU (device = torch.device('cuda') # Uncomment this to run on GPU),没法q行原因? zhengxia says: Edit -> Notepad settings -> select GPU.如果一个新?sh)脑Q你肯定要自己配|下cuda和cudnnQ谷歌胦(ch)大气_,相当q些都帮你做好了?/div>
]]>Error:Cannot start process, the path specified for working directory is not a directoryhttp://www.shnenglu.com/guijie/archive/2018/11/05/216033.html杰哥杰哥Mon, 05 Nov 2018 01:59:00 GMThttp://www.shnenglu.com/guijie/archive/2018/11/05/216033.htmlhttp://www.shnenglu.com/guijie/comments/216033.htmlhttp://www.shnenglu.com/guijie/archive/2018/11/05/216033.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/216033.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/216033.htmlIf I open one file such as "hw3_prob4Sol.py", the code can run. However, there is an error: Cannot start process, the path specified for working directory is not a directory. I can use the following method to solve this problem. PyCharm change working directory of console
However, if I change the working directory every time, this gives me much trouble. Zhengxia is inspired by "I finally solved the problem.
I think it all started because the first project that I opened with pycharm was in my "download" folder, so the working directory was automatically set to a temporal folder by default and although I moved the project to another folder and I manually changed the working directory from the terminal, it was not working.
The solution was creating a new project and giving a correct path to the new project. It seems very easy but it was not that obvious." from https://stackoverflow.com/questions/28202273/working-directory-error/28975990.
He gave me the suggestion: File -> open, open the directory rather than open the file. For example, "GAN\code\generative-models-master", he said that it is better to make the environment of the pycharm projects consistent (pycharm工程默认加蝲一个环境变?最好同一个工E下环境一?. Then a file ".idea" will be created. In this way, all files of this folder will be seen as a part of this project. In the file ".idea", there will be the historical record, the path setting such as the interpreter. Generally, we do not use this file.
]]> PyCharm skills: indentionhttp://www.shnenglu.com/guijie/archive/2018/10/14/216008.html杰哥杰哥Sat, 13 Oct 2018 21:08:00 GMThttp://www.shnenglu.com/guijie/archive/2018/10/14/216008.htmlhttp://www.shnenglu.com/guijie/comments/216008.htmlhttp://www.shnenglu.com/guijie/archive/2018/10/14/216008.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/216008.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/216008.htmlShift + Tab: Left indention Sui Li says that word, powerpoint and group wiki (foreseer) also use this.
]]>How to read *.mat file in python?http://www.shnenglu.com/guijie/archive/2018/10/14/216007.html杰哥杰哥Sat, 13 Oct 2018 20:47:00 GMThttp://www.shnenglu.com/guijie/archive/2018/10/14/216007.htmlhttp://www.shnenglu.com/guijie/comments/216007.htmlhttp://www.shnenglu.com/guijie/archive/2018/10/14/216007.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/216007.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/216007.htmlimport scipy.io as sio
]]>How to read *.data in Matlab and Pythonhttp://www.shnenglu.com/guijie/archive/2018/10/13/216005.html杰哥杰哥Fri, 12 Oct 2018 20:33:00 GMThttp://www.shnenglu.com/guijie/archive/2018/10/13/216005.htmlhttp://www.shnenglu.com/guijie/comments/216005.htmlhttp://www.shnenglu.com/guijie/archive/2018/10/13/216005.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/216005.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/216005.htmlSee P2 of "HW2_545_2018_"
In Matlab:
z = dlmread('spambase.data',',');
In Python:
import numpy as np
z = np.genfromtxt('spambase.data', dtype=float, delimiter=',')
]]>product in python: np.dot, np.multiply, *http://www.shnenglu.com/guijie/archive/2018/10/06/215992.html杰哥杰哥Sat, 06 Oct 2018 00:33:00 GMThttp://www.shnenglu.com/guijie/archive/2018/10/06/215992.htmlhttp://www.shnenglu.com/guijie/comments/215992.htmlhttp://www.shnenglu.com/guijie/archive/2018/10/06/215992.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/215992.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/215992.htmlhttps://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.dot.html
Dot product of two arrays. Specifically,
If both a and b are 1-D arrays, it is inner product of vectors (without complex conjugation).
If both a and b are 2-D arrays, it is matrix multiplication, but using matmul or a@b is preferred.
If either a or b is 0-D (scalar), it is equivalent to multiply andusing numpy.multiply(a,b) or a*b is preferred.
If a is an N-D array and b is a 1-D array, it is a sum product over the last axis of a and b.
If a is an N-D array and b is an M-D array (where M>=2), it is a sum product over the last axis of a and the second-to-last axis of b:
dot(a, b)[i,j,k,m] =sum(a[i,j,:] * b[k,:,m])
What does the last two points mean? My understanding is that 2-D arrays are a matrix. N-D array is a tensor. The aforementioned example is very clear. Both a and b are 3-D arrays.
]]>Interpreter of Pycharmhttp://www.shnenglu.com/guijie/archive/2018/10/05/215990.html杰哥杰哥Fri, 05 Oct 2018 00:59:00 GMThttp://www.shnenglu.com/guijie/archive/2018/10/05/215990.htmlhttp://www.shnenglu.com/guijie/comments/215990.htmlhttp://www.shnenglu.com/guijie/archive/2018/10/05/215990.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/215990.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/215990.htmlYang Zhou says that there can be infinity python.exe in your computer. Maybe some install numpy while some not.
Some other interpreters on my computer:
C:\Users\think\PycharmProjects\Test\venv\Scripts\python.exe Even if I reinstall my operating system, the files in C:\Users\think\PycharmProjects do not need to be stored since this in an empty project.
I have set C:\Users\think\Anaconda3\python.exe as the default interpreter. This interpreter has installed numpy. How can we set this? pycharm -> File -> Default settings
pycharm -> File -> settings -> show all -> existing environment
One interesting fact is that if I name a directory as _numpy and "import numpy as np" will have error. This error can be solved by changing the name of the directory from _numpy to _numpy1.
]]>pycharm 默认布局׃http://www.shnenglu.com/guijie/archive/2018/08/28/215883.html杰哥杰哥Mon, 27 Aug 2018 21:26:00 GMThttp://www.shnenglu.com/guijie/archive/2018/08/28/215883.htmlhttp://www.shnenglu.com/guijie/comments/215883.htmlhttp://www.shnenglu.com/guijie/archive/2018/08/28/215883.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/215883.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/215883.html菜单 Window>restore default layout。但是我的菜单栏没有window。ؕ点,菜单栏下面一行右键,有Customize Menus and ToolbarsQ?Restore All Defaults。菜单栏有了Window
On the group meeting of Oct 3, 2018, Jiaqi shows his bar. I asked that why his variance is very small. He said that he uses the standard error (https://en.wikipedia.org/wiki/Standard_error), which is standard derivation divided by the square root of the number of trials. According to the notes of my undergraduate course probability: (1) D(ax+b) = a*a*D(x), (2) the second line of "中心极限定理". x bar is seen as a random variable, we have std(x bar) = std(x)/sqrt(n). I ask Jiaqi which tool he uses to draw his figure. He says he uses python, bar of matplotlib. https://matplotlib.org/api/_as_gen/matplotlib.pyplot.bar.html. The mean of the errors and standard error should be computed first and then be used as the input of xerr and yerr. I check my TNNLS 2017 paper and I find that I show the std. Maybe next time I can show the standard error.
例:(x)caffe-master-20151202\caffe-master\matlab\demo\classification_demo.m, im = imread('../../examples/images/cat.jpg'); ----------------------------------------------------------------------
想编一个@环,每个文g名依ơ是1Q?Q等到num for i =1:num savefile = [num2str(i),'.mat'];
If I put Homework2Q2.py in another content(目录) and I use the "E:\OneDrive - ustc.edu\Lecture\ustc\Artificial intelligence related\Machine learning\Umich\..."in line 4, there is an error as follows: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 30-31: truncated \uXXXX escape
Zhou Yang says that in Python '\n' has a specific meaning. Similarly, python will think '\u' and '\U' has a specific meaning. Write '\\u' and '\\U' instead. Zhengxia says that there are two other ways to solve this problem: (1) r'E:\OneDrive - ustc.edu\Lecture\ustc\Artificial intelligence related\Machine learning\Umich\...' (2) use / rather than \