在鹅厂工作的广西表妹教我用Python生成会跳舞的美女~

Python实现文章自动生成 Python实现文章自动生成  下面的Python程序实现了通过从网页抓取一篇文章,然后根据这篇文章来生成新的文章,这其中的原理就是基于概率统计的文本分析。   过程大概就是网页抓取数据->统计分析->生成新文章。网页抓取数据是通过BeautifulSoup库来抓取网页上的文本内容。统计分析这个首先需要使用ngram模型来把文章进行分词并统计频率。因为文章生成主要依据马尔可夫模型,所以使用了2-g 阅读详情

导语

我今年31,没有女朋友,身体健康,性取向正常,不抽烟不喝酒不嫖娼,因为孤身一人在外地,技术宅,圈子又小,所以不知不觉单到现在。相亲的都是老家介绍,网上聊着聊着就没有后续了,所以就像一条咸鱼一样pia着,家里只知道催我结婚。表妹心疼我,为了逗我开心,教我用Python制作会跳舞的美女。作为新时代的活雷锋,在这里分享给大家。
在这里插入图片描述

开发工具

Python版本:3.6.4

相关模块:

torch0.4.1模块;
torchvision
0.2.2模块;
opencv-python模块;
argparse模块;
numpy模块;
以及一些Python自带的模块。

环境搭建

安装Python并添加到环境变量,pip安装需要的相关模块即可。

(PS:CUDA环境配置请自行Google教程。)

原理简介

这里我们利用VAE的原理来生成会跳舞的小姐姐呗。先简单介绍一下理论知识,要说VAE,就得先谈谈自动编码器,自动编码器最开始用于数据压缩,其原理图十分简单直观:

图片

在模型训练时,输入图片首先通过一个编码器(现在当然是神经网络啦)将输入数据降维到一个code,接着将code输入到解码器(当然还是神经网络啦)生成一个与输入相同大小的图片,网络的优化目标就是使得输入编码器的图

奇怪的日常 [ 2 ]:Python下合成萝莉/御姐音 奇怪的日常 [ 2 ]:Python下合成萝莉/御姐音--基于百度AI开放平台1. 百度AI平台2.如何实现文字转语音2.1 cmd安装ai包2.2 百度AI平台注册2.3 文字转语音3.运行报错与参数文档 工具/环境/语言:macos, python,anaconda 1. 百度AI平台 地址:https://ai.baidu.com 语音识别文档:https://ai.baidu.com/ai-doc/SPEECH/Ek39uxgre 2.如何实现文字转语音 2.1 cmd安装ai包 pip insta 阅读详情

相关推荐

Pandas入门教程(二十二):股票数据分析实战——yfinance 获取数据、技术指标与收益率分析

把 Pandas 用在真实场景,才能体会它的价值。本文以茅台股票为例,用 yfinance 获取历史行情,完成缺失值处理与列筛选,绘制收盘价曲线,计算 SMA 移动平均线与 RSI 相对强弱指数,并通过日收益率、累计收益率和波动率完成完整的量化分析流程。

Smell_of_earth的博客 332

如何处理动态语言(Python / JS)的“隐形”调用链?

本文揭示动态语言(Python/JS)中静态AST解析导致调用链“断链”的核心问题,提出通过运行时追踪补全图谱的解决方案。基于Code-Graph-RAG的cgr trace机制,分别利用pytest插件与V8 Profiler捕获真实调用路径,将动态边合并至静态图谱,并在权重体系中提升动态边优先级。实践表明,该方法可显著提升图谱覆盖率,实现“结构+行为”双视角理解代码,为MCP与Rerank系统提供可靠支持。

xianyinsuifeng的博客 411

WPS Office 2019 For Linux二次开发全流程:从源码下载到Demo运行

本文详细介绍了在Linux环境下进行WPS Office 2019 C++二次开发的全流程,涵盖从开发环境准备、源码获取、核心依赖(Qt与WPS)安装配置,到最终编译运行官方Demo的完整步骤。文章重点解析了环境搭建中的常见问题与解决方案,旨在帮助开发者快速上手WPS二次开发。

weixin_29001423的博客 390

告别混乱代码!在Arduino IDE中管理多文件项目的5个必备技巧

本文分享了在Arduino IDE中管理多文件项目的5个必备技巧,帮助开发者告别混乱代码。通过代码分割和模块化设计,提升编译效率、降低内存占用,并实现功能解耦。重点介绍了头文件设计、CPP文件实现、调试技巧和工业级目录结构,让你的Arduino项目像乐高积木一样清晰易维护。

fun88的博客 361

Vue3实战:从零构建ElementPlus后台管理系统全流程

本文详细介绍了从零开始使用Vue3和ElementPlus构建后台管理系统的全流程。内容涵盖环境准备、项目初始化、Vite配置、SCSS样式体系搭建、ElementPlus组件库引入与配置,以及封装可复用的SvgIcon组件进行图标管理,旨在帮助开发者快速搭建现代化、可维护的中后台应用。

weixin_29011239的博客 160

别再折腾SNAP了!ENVI 5.6.0 直接拖拽打开Sentinel-2 L2A数据的正确姿势

本文详细介绍了ENVI 5.6.0直接处理Sentinel-2 L2A数据的高效方法,无需通过SNAP进行繁琐的重采样预处理。通过直接拖拽XML文件,用户可以快速加载不同分辨率的波段数据,显著提升工作效率。文章还对比了直接打开与SNAP重采样流程的优劣,并提供了常见问题解决方案和高级应用技巧。

weixin_30296405的博客 635

基于4G cat.1的低功耗车牌识别摄像头模组介绍

在消费类摄像头领域,4G低功耗相机已经非常普遍,在可视门锁,婴儿看护,户外监控等领域都获得了很好的应用.但是在工业领域,低功耗相机的应用还不是那么广泛.这里要介绍一款基于4G cat.1的低功耗车牌识别摄像头模组,在待机状态只有MCU和毫米波雷达以1Hz的频率工作,功耗低至500uA,并可以通过4G模块远程唤醒模组.

bindaz的专栏 1647

YOLOv11火焰识别:从环境搭建到GUI部署的完整工程实践

目标检测是计算机视觉的核心任务之一,它通过定位和分类图像中的物体,为机器赋予“看懂”世界的能力。其原理通常基于深度学习模型,如YOLO系列,通过卷积神经网络提取特征并预测边界框与类别。这项技术的价值在于将算法能力转化为实际生产力,广泛应用于安防监控、工业质检、自动驾驶等场景。在工程实践中,环境配置的稳定性与数据质量往往决定项目成败,而模型部署的易用性直接影响最终用户体验。本文以火焰识别这一具体应用为切入点,详细解析了如何利用YOLOv11完成从零到产品化的全链路流程,其中涉及Conda虚拟环境管理、PyTo

weixin_29483277的博客 236

精通 Android NDK/JNI:从入门到精通实战与面试精粹

在Android开发中,

郑伟强dev的专栏 144

华为OD机试真题 新系统【小花获胜的奶茶】

华为OD机试真题 新系统【小花获胜的奶茶】,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。华为OD机试真题 【小花获胜的奶茶】多语言题解。

qq_45776114的博客 385

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

上一篇: Python是不是被严重高估了?
下一篇: 34岁从头开始学python,成功转行Python工程师,年薪30W+,经验总结都在这
Python王饱饱
博客等级 码龄5年 504粉丝 165原创
评论 6
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值