[引用]该C#程序可将文本文件藏于位图中,也可导出之!

vs2010编写的程序在2003系统无法定位程序输入点DecodePointer于动态链接库kernel32.dll上解决方案 从国外的网站看到的,亲测可用; 下载链接 http://yunpan.cn/cA2tSzH9bq6FN  访问密码 b492 Encode Pointer Library, by LoRd_MuldeR ======================================================= This library was created to a 阅读详情
http://blog.csdn.net/yiruoyun/archive/2004/10/18/141514.aspx

//使用方法:
// BmpSafe.exe /file2bmp (input BMP) (input file to hide) [output file]
//BmpSafe.exe /bmp2file (data BMP) [output file]

using System;
using System.IO;
using System.Drawing;

public class Bitmap24Writer
{
 protected Bitmap bmp;
 protected int curX, curY, iRGB;
 protected uint bitsLeft, bitsTotal;
 protected byte r, g, b;

 public Bitmap24Writer(Bitmap bmp)
 {
  if (bmp.PixelFormat != System.Drawing.Imaging.PixelFormat.Format24bppRgb)
   throw new ArgumentException();
  // assign vars
  curX       = curY = iRGB = 0;
  this.bmp   = bmp;
  bitsLeft   = bitsTotal = (uint)bmp.Height * (uint)bmp.Width * 3;
 }

 public uint GetUnusedBitCount()
 {
  return bitsLeft;
 }

 public uint GetMaxBitStorageCount()
 {
  return bitsTotal;
 }

 public Bitmap GetBitmap()
 {
  return bmp;
 }

 public bool WriteByte(byte by)
 {
  if (bitsLeft < 8)
   return false;

  uint bits2Do = 8;

  for (; curX < bmp.Width; curX++)
  {
   if (curY >= bmp.Height)
    curY = 0;

   for (; curY < bmp.Height; curY++)
   {
    if (bits2Do == 0)
     return true;

    Color col = bmp.GetPixel(curX, curY);
    r = col.R;
    g = col.G;
    b = col.B;

    for ( ; ; )
    {
     byte curBit = (byte)(by & 1);

     switch( iRGB )
     {
      case 0:
       r = (byte)(r & 0xFE);
       r |= curBit;
       break;

      case 1:
       g = (byte)(g & 0xFE);
       g |= curBit;
       break;

      case 2:
       b = (byte)(b & 0xFE);
       b |= curBit;
       break;
     }
     --bits2Do;
     --bitsLeft;
     by >>= 1;
     bmp.SetPixel(curX, curY, Color.FromArgb(r, g, b));
     if (iRGB == 2)
     {
      iRGB = 0;
      break;
     }
     iRGB++;
     if (bits2Do == 0)
      return true;
    }
   }
  }
  return true;
 }
}

public class Bitmap24Reader
{
 protected Bitmap bmp;
 protected int curX, curY, iRGB;
 protected uint bitsLeft, bitsTotal;

 public Bitmap24Reader(Bitmap bmp)
 {
  if (bmp.PixelFormat != System.Drawing.Imaging.PixelFormat.Format24bppRgb)
   throw new ArgumentException();
  curX       = curY = iRGB = 0;
  this.bmp   = bmp;
  bitsLeft   = bitsTotal = (uint)bmp.Height * (uint)bmp.Width * 3;
 }

 public uint GetUnusedBitCount()
 {
  return bitsLeft;
 }

 public uint GetMaxBitStorageCount()
 {
  return bitsTotal;
 }

 public Bitmap GetBitmap()
 {
  return bmp;
 }

 public bool ReadByte(out byte by)
 {
  by = 0;

  if (bitsLeft < 8)
   return false;

  byte bit = 0;
  uint bits2Do = 8;
  for (; curX < bmp.Width; curX++)
  {
   if (curY >= bmp.Height)
    curY = 0;

   for (; curY < bmp.Height; curY++)
   {
    if (bits2Do == 0)
     return true;

    Color col = bmp.GetPixel(curX, curY);
    for ( ; ; )
    {
     switch( iRGB )
     {
      case 0:
       bit = (byte)(col.R & 1);
       break;

      case 1:
       bit = (byte)(col.G & 1);
       break;

      case 2:
       bit = (byte)(col.B & 1);
       break;
     }
     --bits2Do;
     --bitsLeft;
     by |= (byte)(bit << 7);
     if (bits2Do != 0)
      by >>= 1;
     if (iRGB == 2)
     {
      iRGB = 0;
      break;
     }
     iRGB++;
     if (bits2Do == 0)
      return true;
    }
   }
  }
  return true;
 }
}

public class BitmapWorks
{
 public static bool Data2Bmp(FileStream dataStream, FileStream bmpStream, string outFName, out string error)
 {
  error = "";

  Bitmap bmp;
  try
  {
   bmp = new Bitmap(bmpStream);
  }
  catch
  {
   error = "Are you sure the specified bitmap is a valid bitmap ?";
   return false;
  }
  if (bmp.PixelFormat != System.Drawing.Imaging.PixelFormat.Format24bppRgb)
  {
   error = "Please drop only 24bit bitmaps,thanks !";
   return false;
  }

  error += "-> Bitmap info: height=" + bmp.Height + " width=" + bmp.Width + ".../n";

  if (dataStream.Length == 0)
  {
   error = "Input data has a not supported size of 0 !";
   return false;
  }
  uint maxByteStorage = ((uint)bmp.Height * (uint)bmp.Width * 3) / 8;
  error += "-> Up to " + (maxByteStorage-4) + " bytes could be stored in this bitmap.../n";
  if (maxByteStorage < dataStream.Length + 4)
  {
   error = "Not enough pixel in target bitmap to hide the input data block !";
   return false;
  }

  Bitmap24Writer bmpWriter = new Bitmap24Writer(bmp);
  uint dataSize = (uint)dataStream.Length;
  try
  {
   for (uint u = 0; u < 4; u++)
   {
    bmpWriter.WriteByte( (byte)dataSize );
    dataSize >>= 8;
   }
   for (uint u = 0; u < dataStream.Length; u++)
    bmpWriter.WriteByte( (byte)dataStream.ReadByte() );
  }
  catch
  {
   error = "Error while modifing the bitmap's pixels !";
   return false;
  }

  double maxBitStorage = bmpWriter.GetMaxBitStorageCount();
  double spaceUsed = (100 * (maxBitStorage - bmpWriter.GetUnusedBitCount())) / maxBitStorage;
        error += "-> Space used: " + Convert.ToUInt32(spaceUsed) + "%.../n";

  try
  {
   if ( File.Exists( outFName ) )
    File.Delete( outFName );
   bmpWriter.GetBitmap().Save(outFName);
  }
  catch
  {
   error = "Couldn't save output to " + outFName + " !";
   return false;
  }

  error += "-> Output saved to: " + outFName + ".../n";

  return true;
 }

 public static bool Bmp2Data(FileStream bmpStream, string outFName, out string error)
 {
  error = "";

  Bitmap bmp;
  try
  {
   bmp = new Bitmap(bmpStream);
  }
  catch
  {
   error = "Are you sure the specified bitmap is a valid bitmap ?";
   return false;
  }

  Bitmap24Reader bmpReader;
  try
  {
   bmpReader = new Bitmap24Reader(bmp);
  }
  catch (ArgumentException)
  {
   error = "This isn't a 24bit bitmap !";
   return false;
  }

  FileStream outStream;
  try
  {
   outStream = File.Create( outFName );
  }
  catch
  {
   error = "Couldn't create output file: " + outFName + " !";
   return false;
  }
  uint dataSize = 0;
  byte outByte;
  try
  {
   for (uint u = 0; u < 4; u++)
   {
    if ( !bmpReader.ReadByte( out outByte ) )
     throw new Exception();
    dataSize |= (uint)( outByte << 8*3 );
    if (u != 3)
     dataSize >>= 8;
   }
   error += "-> Size of hidden data: " + dataSize + " bytes.../n";
   for (uint u = 0; u < dataSize; u++)
   {
    if ( !bmpReader.ReadByte( out outByte ) )
     throw new Exception();
    outStream.WriteByte( outByte );
   }
  }
  catch
  {
   error = "Exception caught while reading the hidden data !";
   return false;
  }
  finally
  {
   outStream.Close();
  }

  error += "-> Output saved to: " + outFName + ".../n";

  return true;
 }

}

class BmpSafe
{
 public static string cmdLine =
  "Command line:/n" +
  "    BmpSafe.exe /file2bmp (input BMP) (input file to hide) [output file]/n" +
  "    BmpSafe.exe /bmp2file (data BMP) [output file]";

 private static string serviceOne = "/file2bmp";
 private static string serviceTwo = "/bmp2file";

 [STAThread]
 static void Main(string[] args)
 {
  Console.WriteLine(
   "BmpSafe - hide files in 24bit bitmaps/n" +
   "          a little steganografie implementation/n" +
   "          by yoda/n" +
   "-------------------------------------------------------------------------------/n");

  string inFile = "", inBmp, outFile;
  bool bFile2Bmp;
  if (args.Length < 2)
  {
   Console.WriteLine("!! Invalid number of arguments :(");
   Console.WriteLine(cmdLine);
   return; // ERR
  }
  if ( String.Compare(args[0], serviceOne, true) == 0 )
   bFile2Bmp = true;
  else if ( String.Compare(args[0], serviceTwo, true) == 0)
   bFile2Bmp = false;
  else
  {
   Console.WriteLine("!! First parameters must be either /"/file2bmp/" or /"/bmp2file/" !");
   return;
  }

  inBmp = args[1];
  if (bFile2Bmp)
  {
   if (args.Length < 3)
   {
    Console.WriteLine("!! Invalid number of arguments :(");
    Console.WriteLine(cmdLine);
    return;
   }
   inFile = args[2];
   if (args.Length > 3)
    outFile = args[3];
   else
    outFile = "Secret.BMP";
  }
  else
  {
   if (args.Length > 2)
    outFile = args[2];
   else
    outFile = "Secret.bin";
  }
  
  Console.WriteLine("-> Processing input...");
  try
  {
   string err;
   bool ret;

   if (bFile2Bmp)
    ret = BitmapWorks.Data2Bmp(
     File.OpenRead(inFile),
     File.OpenRead(inBmp),
     outFile,
     out err );
   else
    ret = BitmapWorks.Bmp2Data(
     File.OpenRead(inBmp),
     outFile,
     out err);
   if (!ret)
   {
    Console.WriteLine("!! " + err);
    return;
   }
   else
    Console.Write( err );
  }
  catch(FileNotFoundException)
  {
   Console.WriteLine("!! At least one file could not be found :(");
   return;
  }
  catch
  {
   Console.WriteLine("!! An exception occurred :(");
   return;
  }

  Console.WriteLine("-> Job done...");

  return;
 }
}

探索 C# 位图(Bitmap)处理:从历史到实践的全面指南 介绍了 C# 中的位图处理,涵盖位图的历史、原理、常用方法及高级操作,帮助理解图像处理的核心概念与技巧。 阅读详情

相关推荐

C#并口热敏小票打印机打印位图

最近一直在研究并口小票打印机打印图片问题,这也是第一次和硬件打交道,不过还好,最终成功了。   这是DEMO的窗体:   下面是打印所需要调用的代码: class LptControl { private string LptStr = "lpt1"; public LptControl(string l_LPT_Str) {

蒋倩兰——蕙质兰心 2万+

该C#程序可将文本文件藏于位图中,也可导出之。

//使用方法:// BmpSafe.exe /file2bmp (input BMP) (input file to hide) [output file]//BmpSafe.exe /bmp2file (data BMP) [output file]using System;using System.IO;using System.Drawing;public class Bitmap24W

cacacy的专栏 999

使用Excel的VBA来读取和修改bmp位图像素数据

很明显,需要使用VBA代码了。 点击此处下载全部源程序 选择一个8位或者24位的bmp位图来打开。 上图是一个8位位图的像素数据。 上图是一个24位位图的像素数据,由于该24位位图会灰色的位图,所以,RGB的值是一样的。 【更多文章】 [译]在C# .NET2.0实现单实例应用程序[原]ManageApps:C#读取Windows系统中的已经安装的程序并

apk508 8232

BMP图形文件分析类(c#)

1using System;  2using JJBase.FILE;  3namespace JJBase.Image  4{  5    /**////   6    /// BMP 的摘要说明。  7    ///   8    public class BMP  9    { 10         11        public BMP() 12        { 13         

深度Java 4665

Rockchip RK3568实战:手把手教你调试I2S音频驱动(附ALSA设备树配置详解)

本文提供Rockchip RK3568平台I2S音频驱动的实战调试指南。详细解析了从硬件连接到软件配置的全过程,重点涵盖ALSA驱动框架下的设备树配置、时钟计算、DMA参数设置以及常见问题(如无声、爆音)的排查与解决方法,帮助开发者快速定位并解决音频驱动难题。

weixin_28358083的博客 512

PPPoe的抓包分析(详细)

PPPoe的报文结构 可以看出PPPoe的报文结构其实很简单,只不过是将PPPoe的报文塞到以太网的载荷中,而且它的头部字段也十分的简单,TLV就不说了,code字段表示了PPPoe不同的报文类型,比较常见的就是上面的五个报文了,PPPoe的报文类型其实还蛮多的。session ID主要的作用就是标识一段会话,因为使用PPPoe的最主要作用就是使得多台设备可以借助以太网多点接入多点访问的特点去和一台设备做上网认证请求,这样运营商一台认证设备就可以满足多个用户的认证请求,这和PPP相比起来好的不止一点。

qq_47529104的博客 7881

Visual Studio2011安装问题(更新无法定位程序输入点_Atomic_fetch_sub_4动态链接库MSVCR110.dll上的问题)

1、The Application Data folder for Visual Studio could not be created. 2、无法定位程序输入点_Atomic_fetch_sub_4动态链接库MSVCR110.dll上     以前一直都是直接在C盘下安装VS,没发生过什么问题,这次把VS11 Beta版装到D盘下,在运行时出现The Application Data f

sunny2038的专栏 1万+

TCP三次握手,四次挥手的全过程,为什么需要三次握手,四次挥手

文章目录TCP介绍三次握手四次挥手滑动窗口拥塞避免算法 TCP介绍 三次握手 四次挥手

热爱编程的菜鸟 1万+

C#程序可将文本文件藏于位图中,也可导出

//使用方法: // BmpSafe.exe /file2bmp (input BMP) (input file to hide) [output file] //BmpSafe.exe /bmp2file (data BMP) [output file] using System; using System.IO; using System.Drawing; public class Bitma

深度Java 3910

从Peer到脉冲地震波:免费Python工具全流程配置教程(PyCharm+Anaconda)

本文详细介绍了如何使用Python工具链(PyCharm+Anaconda)实现从Peer数据库获取地震波数据到生成脉冲地震波的全流程配置。通过开源工具EQTOOL和PySeismicGen,结合Python环境搭建、数据格式转换和脉冲地震动生成技术,为结构抗震分析提供高效、灵活的解决方案。

weixin_29093169的博客 434

云漾AI创作平台实战:如何用GPT4.0+Midjourney快速生成商业级插画(附Prompt模板)

本文详细介绍了如何利用云漾AI创作平台结合GPT4.0和Midjourney快速生成商业级插画。通过智能文案生成与视觉化工作流,大幅提升创作效率,适用于电商、社交媒体等多种场景。文章包含实用Prompt模板和参数调整技巧,帮助设计师和内容创作者高效产出专业插画。

weixin_29251567的博客 229

该C#程序可将文本文件藏于位图中,也可导出之

//使用方法:// BmpSafe.exe /file2bmp (input BMP) (input file to hide) [output file]//BmpSafe.exe /bmp2file (data BMP) [output file]using System;using System.IO;using System.Drawing;public class Bitmap24W

肄若芸(yiruoyun)的专栏 2057

NLP实践——利用自己的语料进行Mask Language Model预训练

#!/usr/bin/env python # coding: utf-8 # In[1]: import os import json import copy from tqdm.notebook import tqdm import torch from torch.optim import AdamW from torch.utils.data import DataLoader, Dataset from transformers import BertForMaskedLM, BertTo

weixin_44826203的博客 1万+

C#结合JS解决Word添加无效位图导致进程停滞的问题

本文将介绍解决使用WordApp.Selection.InlineShapes.AddPicture方法时,添加无效的位图文件导致的服务器端 WORD 进程停滞,页面无响应的问题。

初九之潜龙勿用 4327

基于STM32F427的模拟SSI协议绝对式编码器位置反馈通信

基于STM32F427的模拟SSI协议绝对式编码器位置反馈通信

xeke997的博客 6077

【YoloV12改进策略】基于流形约束超连接(mHC)增强YoloV12全局特征提取能力_独家复现_梁文峰署名论文

论文标题:流形约束超连接 (Manifold-Constrained Hyper-Connections, mHC)核心问题:针对超连接 (Hyper-Connections, HC) 扩展残差流宽度时破坏恒等映射、引发训练不稳定性和高内存开销的问题,提出一种约束性框架。目标:恢复残差连接的稳定性与可扩展性,同时保持HC的性能增益。基准模型:基于DeepSeek-V3的MoE架构,进行了3B、9B、27B模型的实验验证。论文图示mHC 是一个通用的HC扩展框架。

m0_47867638的博客 1365

C# WinForm实现画笔签名及解决MemoryBmp格式问题

​我的文章 《C# 结合JavaScript实现手写板签名并上传到服务器》主要介绍了 web 版的需求实现,本文应项目需求介绍如何通过 C# WinForm 通过画布画笔实现手写签名,并在开发过程中解决遇到的一些格式转换的问题,提供一些思路。

初九之潜龙勿用 5218

深度学习工具包 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")

C++与C#创建位图,是否需要区分RGB和BGR模式

C++与C#创建位图,是否需要区分RGB和BGR模式

wangnaisheng的专栏 1208

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

C#+MySQL操作Blob对象,实现位图存取

本节介绍使用C#操作MySQL数据库中的二进制大对象BLOB,实现了位图的存储和读取。 1.建立和MySQL的连接 private void btnConnect_Click(object sender, EventArgs e) { if (m_con != null) {

lintaoshen的专栏 1321

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

上一篇: [引用]dotNET下面调用Access中存储过程的方法
下一篇: [引用]C#钩子本线程内消息拦截
xdev
博客等级 码龄25年 1粉丝 33原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址